nicolaus wrote:In the proberty off the splitt_left you can see that i have set a Splitt position at 220.
But if you Compile / Run you see that the Splittposition is alltimes 0
Seems like a PB issue : when you create the second splitter with the first splitter, it seems to reset the first splitter position.
You have to move the SetGadgetState() function :
Code: Select all
;{- Constants
;{ Windows
Enumeration
#Window_0
EndEnumeration
;}
;{ Status bars
Enumeration
#StatusBar_Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
#tree_forms
#tree_gadgets
#plitt_left
#scrl_haupt
#splitt_haupt
EndEnumeration
;}
;}
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 288, -10, 665, 555, #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered|#PB_Window_WindowCentered|#PB_Window_MaximizeGadget, "#Window_0")
If CreateStatusBar(#StatusBar_Window_0, WindowID(#Window_0))
EndIf
If CreateGadgetList(WindowID(#Window_0))
TreeGadget(#tree_forms, 0, 0, 0, 0, #PB_Tree_AlwaysShowSelection)
TreeGadget(#tree_gadgets, 0, 0, 0, 0, #PB_Tree_AlwaysShowSelection)
SplitterGadget(#plitt_left, 0, 0, 0, 0, #tree_forms, #tree_gadgets, #PB_Splitter_Separator)
;SetGadgetState(#plitt_left, 220)
ScrollAreaGadget(#scrl_haupt, 0, 0, 0, 0, 440, 515, 10, #PB_ScrollArea_Flat) ;>
CloseGadgetList() ;<
SplitterGadget(#splitt_haupt, 0, 0, 665, 535, #plitt_left, #scrl_haupt, #PB_Splitter_Separator|#PB_Splitter_Vertical) ; resets first splitter position !
SetGadgetState(#splitt_haupt, 175)
SetGadgetState(#plitt_left, 220) ; <----- moved here
; Gadget Resizing
PureRESIZE_SetGadgetResize(#tree_forms, 1, 1, 0, 0)
PureRESIZE_SetGadgetResize(#tree_gadgets, 1, 1, 0, 0)
PureRESIZE_SetGadgetResize(#plitt_left, 1, 1, 0, 0)
PureRESIZE_SetGadgetResize(#scrl_haupt, 1, 1, 1, 1)
PureRESIZE_SetGadgetResize(#splitt_haupt, 1, 1, 1, 1)
EndIf
EndIf
EndProcedure
OpenWindow_Window_0()
;{- Event loop
Repeat
Event = WaitWindowEvent()
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadgetID()
EventType = EventType()
If EventGadget = #tree_forms
ElseIf EventGadget = #tree_gadgets
ElseIf EventGadget = #plitt_left
ElseIf EventGadget = #scrl_haupt
ElseIf EventGadget = #splitt_haupt
EndIf
; //////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindowID()
If EventWindow = #Window_0
Break
EndIf
EndSelect
ForEver
;}
nicolaus wrote:and it the example project you can find one more prob.
If you open the Project you can´t press right mouse button in the window for the menu, to add a menu or statusbar or so.
Any way to add a menu to a Window if i have the gadgets over all the window width / height?
You are right !
I will add some emnu items in the main menu.