PanelGadget; Prevent repostion on select of item;

Windows specific forum
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

PanelGadget; Prevent repostion on select of item;

Post by HanPBF »

Hello!

Did not find anything @RSBasic's great tips collection.

How can I prevent, even with a trick, that the text of a panelgadget jumps up for the selected tab item?

Thanks a lot!
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: PanelGadget; Prevent repostion on select of item;

Post by Marc56us »

Check x + size and y + size of elements you put in panel gadget and compare with #PB_Panel_ItemWidth and #PB_Panel_ItemHeight

GetGadgetAttribute() for size panel info
ResizeGadget to change size of gadgets
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

Re: PanelGadget; Prevent repostion on select of item;

Post by HanPBF »

Hello Marcus,

thanks for the hints!

But the problem is, that the top edge is broken by the selected tab.

Setting the indi tab height is not possible, is it?

ResizeGadget does resize the whole panel only.

RSBasic has an example for tab height; but that belongs to all tabs.

I don't like to build an own panel gadget with images and containers.
That way I can build the whole GUI myself...

Doesn't matter; if it's not working, I will try to "overwrite" it with a containergadet.

Thanks!
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: PanelGadget; Prevent repostion on select of item;

Post by Marc56us »

I'm not sure I understand everything (sorry, I use an online translator).

The internal dimensions of the panel and the height of the tab selector are available.

Code: Select all

GetGadgetAttribute()

#PB_Panel_ItemWidth : Returns the width of the inner area where the gadgets are displayed.
#PB_Panel_ItemHeight: Returns the height of the inner area where the gadgets are displayed.
#PB_Panel_TabHeight : Returns height of the panel tabs on top of the gadget.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4636
Joined: Sun Apr 12, 2009 6:27 am

Re: PanelGadget; Prevent repostion on select of item;

Post by RASHAD »

Hi

Code: Select all

; Shows using of several panels...
  If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    PanelGadget     (0, 8, 8, 306, 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")
    CloseGadgetList()
    
    TextGadget(10,10,8,50,20,"Panel 1",#WS_CLIPSIBLINGS|#SS_CENTERIMAGE|#SS_CENTER)
    SetGadgetColor(10, #PB_Gadget_BackColor,$FFFFFF)
    SetWindowPos_(GadgetID(10), #HWND_TOP, 0,0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE)
    TextGadget(20,58,8,50,20,"Panel 2",#WS_CLIPSIBLINGS|#SS_CENTERIMAGE|#SS_CENTER)
    SetGadgetColor(20, #PB_Gadget_FrontColor,$0000FF)
    SetGadgetColor(20, #PB_Gadget_BackColor,$FFFFFF)
    SetWindowPos_(GadgetID(20), #HWND_TOP, 0,0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE)
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
Egypt my love
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

Re: PanelGadget; Prevent repostion on select of item;

Post by HanPBF »

Hello RASHAD,

thanks a lot for making things clear.


Hello Marcus,

thanks for Your help; RASHADs example also shows, what I meant.

Uploading images here is not possible ("only" links to)(?); will see if I find a just in time image upload and link service.
Post Reply