Panel

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
julesd
User
User
Posts: 23
Joined: Fri May 24, 2013 1:39 am

Panel

Post by julesd »

It would be nice if each tab in a Panel can be a different size.

Example tab1 could be 320x240 tab 2 could be 640x480 tab 3 could be 1920x720 and so on.
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Panel

Post by Josh »

Why should Pb do that with a native command? It's actually against the purpose of a panel gadget, and if you really want it, it's done with a few lines.

Code: Select all

OpenWindow (0, 0, 0, 500, 300, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
PanelGadget     (0, 10, 10, 480, 280)
  AddGadgetItem (0, -1, "Panel 1")
  AddGadgetItem (0, -1, "Panel 2")
CloseGadgetList()



Repeat
  Event = WaitWindowEvent()
  
  If EventType() = #PB_EventType_Change

    Select GetGadgetState(0)
      Case 0 : ResizeGadget (0, 10, 10, 480, 280)
      Case 1 : ResizeGadget (0, 10, 10, 380, 180)
    EndSelect

  EndIf

Until Event = #PB_Event_CloseWindow
sorry for my bad english
Post Reply