Im having problems aligning buttons. When in the Default WinXP theme, the buttons align correctly, but as soon as I change to original Win98 theme, run the program again, the buttons jump down about 5 pixels. If I change the windows theme whilst the program is running, the buttons dont go anywhere, they stay aligned. Ive played with SETGADGETLAYOUT, trying 0,1 and 2, but this changes nothing.
My window setup consists of a tabber and a canvas. The buttons in question need to appear on top of the canvas, which they do. Can anyone spot any problems with the code, please?
Global window=CreateWindow( "Window",0,0,780,585,0,3)
;maximizewindow window ;force the window to open up maximum
menu=WindowMenu(window)
filemenu=CreateMenu("File",0,menu)
CreateMenu"New",16,filemenu
CreateMenu "Quit",1,filemenu
UpdateWindowMenu window
Global tabs = CreateTabber (0, 0, ClientWidth(window) ,ClientHeight(window), window)
SetGadgetLayout tabs, 1, 1, 1,1
AddGadgetItem tabs, "Page1"
AddGadgetItem tabs, "Page2"
AddGadgetItem tabs, "Page3"
AddGadgetItem tabs, "Page4"
Global canvas = CreateCanvas( 0,0,ClientWidth(tabs),ClientHeight(tabs),tabs )
Global bar1editbut = CreateButton("",2,ClientHeight(canvas)-494,16,10,canvas,0)
SetGadgetLayout bar1editbut ,1,0,1,0
Global bar1editbut2 = CreateButton("",2,ClientHeight(canvas)-482,16,10,canvas,0)
SetGadgetLayout bar1editbut2 ,1,0,1,0
Global bar1editbut3 = CreateButton("",2,ClientHeight(canvas)-470,16,10,canvas,0)
SetGadgetLayout bar1editbut3 ,1,0,1,0
Global bar1editbut4 = CreateButton("",2,ClientHeight(canvas)-458,16,10,canvas,0)
SetGadgetLayout bar1editbut4 ,1,0,1,0
Global bar1editbut5 = CreateButton("",2,ClientHeight(canvas)-446,16,10,canvas,0)
SetGadgetLayout bar1editbut5 ,1,0,1,0
Global bar1editbut6 = CreateButton("",2,ClientHeight(canvas)-434,16,10,canvas,0)
SetGadgetLayout bar1editbut6 ,1,0,1,0
SetBuffer CanvasBuffer(canvas)
ClsColor 50,50,50
While Not KeyHit(1)
ID=WaitEvent()
If ID=$803 Then End
If ID=$1001 Then
EID=EventData()
Select EID
Case 1
End
End Select
End If
FlipCanvas canvas
Text 20,13, "-------- < Center of button aligns to this in WINXP Default theme"
Text 20,25, "-------- < Center of button aligns to this in WINXP Default theme"
Wend
End
To see the problem, you'll have to switch themes and run the program again.
|