Panelgadget in a Frame3dGadget ?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

Panelgadget in a Frame3dGadget ?

It isn't possible to put a PanelGadget in a Frame3dGadget, 'cause it would be necessary to have a command like ...
- PanelGadget(WindowID,Gadget#, x, y, Width, Heigth)
And instead of the WindowID you should give the Frame3dGadgetID ... very similar to the OpenRichEdit command from the famous El_Choni.

Tell me if there is an other way to put a PanelGadget in a Frame3dgadget.

Just for info: You can see a PanelGadget in a Frame3dgadget at the Blitzbasic IDE, and it look's very kind to me :wink:

MFG
WolfgangS
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Code: Select all

;---[ Fake look, works ]---hWnd = OpenWindow(1,100,100,400,400,#PB_Window_SystemMenu,"FramePanel")
       CreateGadgetList(hWnd)
       Panel  = PanelGadget(1, 6,24,388,300)
       Button = ButtonGadget(2,325,350,50,22,"Quit")
               For a = 1 To 6  
                 AddGadgetItem(1,-1,"File "+Str(a))
                 TextGadget(2+a,10,10,200,25,"Hello World! on Panel "+StrU(a,2))
               Next a
               ClosePanelGadget()
               SetGadgetState(1,0)
       Frame  = Frame3DGadget(9,2,2,396,396,"",1)
 
Repeat
   Select WaitWindowEvent()
      Case #PB_EventCloseWindow: End
      Case #PB_EventGadget: If EventGadgetID() = 2: End: EndIf
   EndSelect
ForEver
;--------------------------
Normally you use SetParent_() or you create a new
Gadgetlist. But this doesnt work with the Frame3DGadget.

Why is this fake look not OK ??

Things that dont work (dont get updated):

Code: Select all

;---[ new Gadget list ]---
hWnd = OpenWindow(1,100,100,400,400,#PB_Window_SystemMenu,"FramePanel")
       CreateGadgetList(hWnd)
       Frame  = Frame3DGadget(9,2,2,396,396,"",1)
       
       CreateGadgetList(Frame)
       Panel  = PanelGadget(1, 2,24,388,300)
 
       Button = ButtonGadget(2,325,350,50,22,"Quit")
               For a = 1 To 6  
                 AddGadgetItem(1,-1,"File "+Str(a))
                 TextGadget(2+a,10,10,200,25,"Hello World! on Panel "+StrU(a,2))
               Next a
               ClosePanelGadget()
               SetGadgetState(1,0)
       
Repeat
   Select WaitWindowEvent()
      Case #PB_EventCloseWindow: End
      Case #PB_EventGadget: If EventGadgetID() = 2: End: EndIf
   EndSelect
ForEver
;-------------------------
and

Code: Select all

;---[ SetParent ]---
hWnd = OpenWindow(1,100,100,400,400,#PB_Window_SystemMenu,"FramePanel")
       CreateGadgetList(hWnd)
       Frame  = Frame3DGadget(0,2,2,396,396,"",1)
       Panel  = PanelGadget(1, 2,24,388,300)
       Button = ButtonGadget(2,325,350,50,22,"Quit")
               For a = 1 To 6  
                 AddGadgetItem(1,-1,"File "+Str(a))
                 TextGadget(2+a,10,10,200,25,"Hello World! on Panel "+StrU(a,2))
               Next a
               ClosePanelGadget()
               SetGadgetState(1,0)
 
SetParent_(Panel,  Frame)  ; Move Panel  INTO Frame
SetParent_(Button, Frame)  ; Move Button INTO Frame
 
Repeat
   Select WaitWindowEvent()
      Case #PB_EventCloseWindow: End
      Case #PB_EventGadget: If EventGadgetID() = 2: End: EndIf
   EndSelect
ForEver
;-------------------
The first code (fake look) works, so why not use it ??

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by WolfgangS.

I love your fake :wink:

"Waitress ... one Beer for my fellow Danilo !"

Thanks & MFG
WolfgangS
Post Reply