[Ann]Trixi's Tabsheets

i am not running retina. Does it work on normal non retina?? also i am using mac osx 10.9

just try the one u posted jason and it is working. so what did u do??

Wont run on windows at all Jason. No error messages, just crashes. MBS 13.5.

Weird. It doesn’t use MBS either. And I don’t have retina so I’m looking for someone to test it there, it works on my MacBook with 10.7.5. Try to change the superclass of the canvas1 object to “TrixisTabPanels” and see if that works Matthew.

I changed the post build retina script to the newer version posted by Beatrix.

With breaks turned on

'PlatformNotSupported
SelectedPicture=new Picture(currentTabStringWidth+4*TabEndCapWidth+lastPixel,TabHeight)

and a bunch of nilobjectexceptions after

if RetinaScaleFactor=1 then
g.DrawPicture(tab_dark_left, lastPixel, 0)

in SelectPicture…

I will peruse through the code…

Trix’s just crashes the Xojo IDE…yours just prompts a blank messagebox which closes and debugbuild ends.

In the DraggingTabPanels class make the default value of RetinaScaleFactor to 1. That might help with some of it.

[quote=56845:@Matthew Combatti]'PlatformNotSupported
SelectedPicture=new Picture(currentTabStringWidth+4*TabEndCapWidth+lastPixel,TabHeight)[/quote]
Do you know if Windows supports pictures without a specified depth? That might be the cause of the platform not supported exception.

The problem in windows was that GDIPlus must be enabled :slight_smile: So I got it running after deleting Trix all together. but there are some line issues in the tabs

https://www.dropbox.com/s/tf31md0f03czw7s/Screenshot%202014-01-03%2018.16.52.png

Setting Retina to 1 makes the line gap even larger.

And you also don’t see the text. Interesting. This is what mine looks like. https://www.dropbox.com/s/t6ksk3rk4jhis9d/Screen%20Shot%202014-01-03%20at%206.22.25%20PM.png

To prevent horrible flickering on windows The control has to be doublebuffered and set transparent to false (for the canvas)

In your paint event…i don’t see where you are “drawing” the text.

In the Tab class the NormalPic and SelectedPic methods are causing the weird lines. The text is drawn into the tabs there to create a picture that is drawn in the paint event.

How does the dragging work on Windows? Does it respond like you would expect or does something else happen?

It drags perfect on windows with the canvas doublebuffered and transparent set to false for the canvas object. As far as the text, you should leave it set to “system” since Lucida Grande is mac specific. After changing the text to System, changing to pixel, and leaving set to 12, fits and works perfect…but the lines still exist. Dragging works perfect though.

Without double buffering the selected tab you are dragging flickers and the non selected ones disappear until mouseup. after double buffering all controls remain but flicker. After disabling transparent on the canvas, nonselected tabs stay and do not flicker, and the selected draggable tab moves without flicker. :slight_smile:

Ok I’ll change the text to system. The lines will be tough for me to fix though since I can’t reproduce it on my Mac. Can you change the Tab normalPic and Selected pic to these:

NormalPic:

[code] dim currentTabStringWidth as integer = StringWidth(aString)
dim lastPixel as Integer = endcap.Width
dim TextAtPixel as integer
NormalPicture=new Picture(currentTabStringWidth+4*TabEndCapWidth+lastPixel,TabHeight)
dim g as Graphics=NormalPicture.Graphics
if RetinaScaleFactor=1 then
g.DrawPicture(tab_light_left, lastPixel, 0)
lastPixel = lastPixel + TabEndCapWidth
TextAtPixel = lastPixel + TabEndCapWidth
g.DrawPicture(tab_light_middle, lastPixel, 0, currentTabStringWidth + 2 * TabEndCapWidth, tab_light_middle.Height, 0, 0, tab_light_middle.Width, tab_light_middle.Height)
lastPixel = lastPixel + currentTabStringWidth + 2 * TabEndCapWidth
g.DrawPicture(tab_light_right, lastPixel-2, 0)
lastPixel = lastPixel + TabEndCapWidth
elseif RetinaScaleFactor > 1 then
g.drawPicture tab_light_left_retina, lastPixel, 0, tab_light_left.Width, tab_light_left.Height, 0, 0, tab_light_left_retina.Width, tab_light_left_retina.Height
lastPixel = lastPixel + TabEndCapWidth
TextAtPixel = lastPixel + TabEndCapWidth
g.DrawPicture(tab_light_middle_retina, lastPixel, 0, currentTabStringWidth + 2 * TabEndCapWidth, tab_light_middle.Height, 0, 0, tab_light_middle_retina.Width, tab_light_middle_retina.Height)
lastPixel = lastPixel + currentTabStringWidth + 2 * TabEndCapWidth
g.drawPicture tab_light_right_retina, lastPixel-2, 0, tab_light_right.Width, tab_light_right.Height, 0, 0, tab_light_right_retina.Width, tab_light_right_retina.Height
lastPixel = lastPixel + TabEndCapWidth
end if
g.TextUnit = FontUnits.Point
g.TextFont = “System”
g.TextSize = 12
dim textWidth as Integer = g.StringWidth(aString)

g.ForeColor = kWindowBackGroundLight

g.DrawString(aString, TextAtPixel, 20 + 1)
g.ForeColor = rgb(0, 0, 0)
g.DrawString(aString, TextAtPixel, 20)[/code]

SelectedPic:

[code] dim currentTabStringWidth as integer = StringWidth(aString)
dim lastPixel as Integer = endcap.Width
dim TextAtPixel as integer
SelectedPicture=new Picture(currentTabStringWidth+4*TabEndCapWidth+lastPixel,TabHeight)
dim g as Graphics=SelectedPicture.Graphics
if RetinaScaleFactor=1 then
g.DrawPicture(tab_dark_left, lastPixel, 0)
lastPixel = lastPixel + TabEndCapWidth
TextAtPixel = lastPixel + TabEndCapWidth
g.DrawPicture(tab_dark_middle, lastPixel, 0, currentTabStringWidth + 2 * TabEndCapWidth, tab_dark_middle.Height, 0, 0, tab_dark_middle.Width, tab_dark_middle.Height)
lastPixel = lastPixel + currentTabStringWidth + 2 * TabEndCapWidth
g.DrawPicture(tab_dark_right, lastPixel-2, 0)
lastPixel = lastPixel + TabEndCapWidth
elseif RetinaScaleFactor>1 then
g.drawPicture tab_dark_left_retina, lastPixel, 0, tab_dark_left.Width, tab_dark_left.Height, 0, 0, tab_dark_left_retina.Width, tab_dark_left_retina.Height
lastPixel = lastPixel + TabEndCapWidth
TextAtPixel = lastPixel + TabEndCapWidth
g.DrawPicture(tab_dark_middle_retina, lastPixel, 0, currentTabStringWidth + 2 * TabEndCapWidth, tab_dark_middle.Height, 0, 0, tab_dark_middle_retina.Width, tab_dark_middle_retina.Height)
lastPixel = lastPixel + currentTabStringWidth + 2 * TabEndCapWidth
g.drawPicture tab_dark_right_retina, lastPixel-2, 0, tab_dark_right.Width, tab_dark_right.Height, 0, 0, tab_dark_right_retina.Width, tab_dark_right_retina.Height
lastPixel = lastPixel + TabEndCapWidth
end if
g.TextUnit = FontUnits.Point
g.TextFont = “System”
g.TextSize = 12
dim textWidth as Integer = g.StringWidth(aString)

g.ForeColor = RGB(245, 245, 245)

g.DrawString(aString, TextAtPixel, 20 + 1)
g.ForeColor = rgb(0, 0, 0)
g.DrawString(aString, TextAtPixel, 20)[/code]

Already Done :slight_smile: Tracking down the Line problem now :slight_smile:

That might fix the line problem. It changes the size by 2 pixels, sort of hacky but might do it.