SplitterGadget co-ordinate problems.
Posted: Fri Jun 13, 2003 3:49 am
Okay, I admit it!! I don't understand the splitter gadget co-ordinate system, they don't make sense to me. I also downloaded the latest gadget updates because I was having the refresh problem destroying windows under XP pro. With the code below, I get the gadgets laid out on screen how I want them (I got something right!!!) but the vertical splitter gadget seems to be taking over the screen when you hover the mouse anywhere to the right. The horizontal splitter is in the right position visibly but no working (sigh)
Code: Select all
#TV_FIRST = $1100
#TVM_SETBKCOLOR = #TV_FIRST + 29
#TVM_SETTEXTCOLOR = #TV_FIRST + 30
#WindowIndex = 0
#GadgetIndex = 0
#ImageIndex = 0
#StatusBarIndex = 0
#MenuBarIndex = 0
#Form = #WindowIndex : #WindowIndex = #WindowIndex + 1
#MenuBar = #MenuBarIndex : #MenuBarIndex = #MenuBarIndex + 1
#Tree = #GadgetIndex : #GadgetIndex = #GadgetIndex + 1
#ListIcon = #GadgetIndex : #GadgetIndex = #GadgetIndex + 1
#Web = #GadgetIndex : #GadgetIndex = #GadgetIndex + 1
#ComboBox8 = #GadgetIndex : #GadgetIndex = #GadgetIndex + 1
#ComboBox9 = #GadgetIndex : #GadgetIndex = #GadgetIndex + 1
#String = #GadgetIndex : #GadgetIndex = #GadgetIndex + 1
#Splitter1 = #GadgetIndex : #GadgetIndex = #GadgetIndex + 1
#Splitter2 = #GadgetIndex : #GadgetIndex = #GadgetIndex + 1
#StatusBar = #StatusBarIndex : #StatusBarIndex = #StatusBarIndex + 1
#StatusBar_Field1 = 0
#StatusBar_Field2 = 1
#StatusBar_Field3 = 2
#StatusBar_Field4 = 3
Procedure.l Form()
If OpenWindow(#Form,175,0,640,480,#PB_Window_SystemMenu|#PB_Window_Invisible,"Work Form1")
CreateMenu(#MenuBar,WindowID(#Form))
MenuTitle("Files")
If CreateGadgetList(WindowID())
TreeGadget(#Tree,#Null,#Null,#Null,#Null,#PB_Tree_AlwaysShowSelection)
SendMessage_(GadgetID(#Tree),#TVM_SETBKCOLOR,0,16744448)
AddGadgetItem(#Tree, -1, "Empty Tree")
ListIconGadget(#ListIcon,#Null,#Null,#Null,#Null,"ListIcon",100,#PB_ListIcon_MultiSelect|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
SendMessage_(GadgetID(#ListIcon),#LVM_SETBKCOLOR,0,16744448)
SendMessage_(GadgetID(#ListIcon4),#LVM_SETTEXTBKCOLOR,0,16744448)
AddGadgetItem(#ListIcon, -1, "List Icon Gadget")
WebGadget(#Web,#Null,#Null,#Null,#Null,"Web5")
ComboBoxGadget(#ComboBox8,0,420,120,200)
ComboBoxGadget(#ComboBox9,125,420,120,200)
StringGadget(#String,245,420,395,20,"")
SplitterGadget(#Splitter1, 0,0,640,415, #Tree,#ListIcon,#PB_Splitter_Vertical|#PB_Splitter_Separator)
SetGadgetState(#Splitter1, 120)
SplitterGadget(#Splitter2, 126,0,514,414, #ListIcon,#Web, #PB_Splitter_Separator)
SetGadgetState(#Splitter2, 120)
CreateStatusBar(#StatusBar,WindowID(#Form))
AddStatusBarField(100)
AddStatusBarField(100)
AddStatusBarField(100)
AddStatusBarField(100)
HideWindow(#Form,0)
ProcedureReturn WindowID()
EndIf
EndIf
EndProcedure
If Form()
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_Event_CloseWindow And EventWindowID() = #Form
CloseWindow(#Form)
EndIf