Arrow buttons in the PanelGadget

Just starting out? Need help? Post your questions and find answers here.
Mohsen

Arrow buttons in the PanelGadget

Post by Mohsen »

Hi all,
How do I prevent the creation of the arrow buttons in the PanelGadget?

I mean these buttons :
Image
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: Arrow buttons in the PanelGadget

Post by RASHAD »

Hi
Workaround

Code: Select all

If OpenWindow(0, 0, 0, 345, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ContainerGadget(#PB_Any,8,8,325,203)
    PanelGadget     (0, 0, 0, 370, 203)
      AddGadgetItem (0, -1, "Panel 1")
        PanelGadget (1, 5, 5, 290, 166)
          AddGadgetItem(1, -1, "Sub-Panel 1")
          AddGadgetItem(1, -1, "Sub-Panel 2")
          AddGadgetItem(1, -1, "Sub-Panel 3")
        CloseGadgetList()
      AddGadgetItem (0, -1,"Panel 2")
        ButtonGadget(2, 10, 15, 80, 24,"Button 1")
        ButtonGadget(3, 95, 15, 80, 24,"Button 2")
      AddGadgetItem (0, -1,"Panel 3")
      AddGadgetItem (0, -1,"Panel 4")
      AddGadgetItem (0, -1,"Panel 5")
      AddGadgetItem (0, -1,"Panel 6")
      CloseGadgetList()
      CloseGadgetList()
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
Egypt my love
Mohsen

Re: Arrow buttons in the PanelGadget

Post by Mohsen »

:D

Code: Select all

If OpenWindow(0, 0, 0, 345, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ContainerGadget(#PB_Any,8,8,325,203)
    PanelGadget     (0, 0, 0, 200, 203)
      AddGadgetItem (0, -1, "Panel 1")
        PanelGadget (1, 5, 5, 180, 166)
          AddGadgetItem(1, -1, "Sub-Panel 1")
          AddGadgetItem(1, -1, "Sub-Panel 2")
          AddGadgetItem(1, -1, "Sub-Panel 3")
        CloseGadgetList()
      AddGadgetItem (0, -1,"Panel 2")
        ButtonGadget(2, 10, 15, 80, 24,"Button 1")
        ButtonGadget(3, 95, 15, 80, 24,"Button 2")
      AddGadgetItem (0, -1,"Panel 3")
      AddGadgetItem (0, -1,"Panel 4")
      AddGadgetItem (0, -1,"Panel 5")
      AddGadgetItem (0, -1,"Panel 6")
      CloseGadgetList()
      CloseGadgetList()
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
a more principled solution?
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: Arrow buttons in the PanelGadget

Post by RASHAD »

OK
Use Multi Rows

Code: Select all

  If OpenWindow(0, 0, 0, 345, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ;ContainerGadget(#PB_Any,8,8,325,203)
    PanelGadget     (0, 8, 8, 330, 203)
    SetWindowLongPtr_(GadgetID(0), #GWL_STYLE, GetWindowLongPtr_(GadgetID(0), #GWL_STYLE) | #TCS_MULTILINE)
      AddGadgetItem (0, -1, "Panel 1")
        PanelGadget (1, 5, 5, 290, 166)
          AddGadgetItem(1, -1, "Sub-Panel 1")
          AddGadgetItem(1, -1, "Sub-Panel 2")
          AddGadgetItem(1, -1, "Sub-Panel 3")
        CloseGadgetList()
      AddGadgetItem (0, -1,"Panel 2")
        ButtonGadget(2, 10, 15, 80, 24,"Button 1")
        ButtonGadget(3, 95, 15, 80, 24,"Button 2")
      AddGadgetItem (0, -1,"Panel 3")
      AddGadgetItem (0, -1,"Panel 4")
      AddGadgetItem (0, -1,"Panel 5")
      AddGadgetItem (0, -1,"Panel 6")
      CloseGadgetList()
      ;CloseGadgetList()
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

Egypt my love
Mohsen

Re: Arrow buttons in the PanelGadget

Post by Mohsen »

Thanks but I do not want to use the multiline style. :?
I want all tabs to be single-line and the arrow buttons not to be created by the panel gadget.
infratec
Always Here
Always Here
Posts: 7619
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Arrow buttons in the PanelGadget

Post by infratec »

Use the TabBarGadget()

viewtopic.php?f=12&t=47588
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: Arrow buttons in the PanelGadget

Post by RASHAD »

No scroll controls

Code: Select all

If OpenWindow(0, 0, 0, 345, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    PanelGadget     (0, 0, 0, 340, 203)
      AddGadgetItem (0, -1, "Panel 1")
        PanelGadget (1, 5, 5, 290, 166)
          AddGadgetItem(1, -1, "Sub-Panel 1")
          AddGadgetItem(1, -1, "Sub-Panel 2")
          AddGadgetItem(1, -1, "Sub-Panel 3")
        CloseGadgetList()
      AddGadgetItem (0, -1,"Panel 2")
        ButtonGadget(2, 10, 15, 80, 24,"Button 1")
        ButtonGadget(3, 95, 15, 80, 24,"Button 2")
      AddGadgetItem (0, -1,"Panel 3")
      AddGadgetItem (0, -1,"Panel 4")
      AddGadgetItem (0, -1,"Panel 5")
      AddGadgetItem (0, -1,"Panel 6")
      CloseGadgetList()
      hwnd = GetWindow_(GadgetID(0),#GW_CHILD	)
      hwnd = GetWindow_(hwnd,#GW_HWNDLAST)
      ShowWindow_(hwnd,#SW_HIDE	)
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
Egypt my love
Mohsen

Re: Arrow buttons in the PanelGadget

Post by Mohsen »

Thanks RASHAD, but it has no effect.
Just change the width of the gadget (0) from 340 to 240, you will see the arrow buttons appear.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: Arrow buttons in the PanelGadget

Post by RASHAD »

Now this one should be OK in all cases :)

Code: Select all

Procedure HideSpin(gad)
  hwnd = GetWindow_(GadgetID(gad),#GW_CHILD   )
  hSpin = FindWindowEx_(GadgetID(gad), hwnd, "msctls_updown32", 0)
  If hSpin
    ShowWindow_(hSpin,#SW_HIDE   )
  EndIf  
EndProcedure

If OpenWindow(0, 0, 0, 345, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  PanelGadget     (0, 0, 0, 200, 203)
    AddGadgetItem (0, -1, "Panel 1")
      PanelGadget (1, 5, 5, 180, 166)
        AddGadgetItem(1, -1, "Sub-Panel 1")
        AddGadgetItem(1, -1, "Sub-Panel 2")
        AddGadgetItem(1, -1, "Sub-Panel 3")
      CloseGadgetList()
    AddGadgetItem (0, -1,"Panel 2")
      ButtonGadget(2, 10, 15, 80, 24,"Button 1")
      ButtonGadget(3, 95, 15, 80, 24,"Button 2")
    AddGadgetItem (0, -1,"Panel 3")
    AddGadgetItem (0, -1,"Panel 4")
    AddGadgetItem (0, -1,"Panel 5")
    AddGadgetItem (0, -1,"Panel 6")
  CloseGadgetList()
  HideSpin(0)
  HideSpin(1)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Egypt my love
Mohsen

Re: Arrow buttons in the PanelGadget

Post by Mohsen »

Thank you very much RASHAD, that was the main solution. :D
Post Reply