ContainerGadget

Found an issue in the documentation ? Please report it here !

Moderator: Documentation Editors

Bitblazer
Enthusiast
Enthusiast
Posts: 736
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

ContainerGadget

Post by Bitblazer »

I don't know if it is a bug or not, but as i was using the containergadget, i noticed that the documentation shows an extremely limited amount of compatible functions. As i had to get the current size of a container gadget, i tried to use gadgetheight() and gadgetwidth() with it and on windows 7 it worked fine.

My question is - which functions are actually supported by the containergadget? Is it limited by platform? The container gadget is hardly useful if it only supports the currently listed functions. So i would either need a replacement or the language / documentation needs an update? :)
Mesa
Enthusiast
Enthusiast
Posts: 349
Joined: Fri Feb 24, 2012 10:19 am

Re: ContainerGadget

Post by Mesa »

Often, it is because of the specificities of windows, linux and osx that may not overlap.

Try to test the same code with windows, linux and osx and compare the different results.


M.
User avatar
mk-soft
Always Here
Always Here
Posts: 5406
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ContainerGadget

Post by mk-soft »

The ContainerGadget does not really exist under Windows and therefore has limited functions.

Link: viewtopic.php?f=3&t=57565&p=432070#p432070

Check Gadget EventType

Code: Select all

;- TOP
Procedure DoEventContainer()
  Select EventType()
    Case #PB_EventType_LeftClick        : Debug " Left mouse button click"
    Case #PB_EventType_RightClick       : Debug " right mouse button click"
    Case #PB_EventType_LeftDoubleClick  : Debug " Left mouse button double click"
    Case #PB_EventType_RightDoubleClick : Debug " Right mouse button double click"
    Case #PB_EventType_Focus            : Debug " Get the focus."
    Case #PB_EventType_LostFocus        : Debug " Lose the focus."
    Case #PB_EventType_Change           : Debug " Content change."
    Case #PB_EventType_DragStart        : Debug " The user tries To start a Drag & Drop operation."
    Case #PB_EventType_Resize           : Debug " The gadget has been resized. DX = " + GadgetWidth(0) + " / DY = " + GadgetHeight(0) 
  EndSelect
EndProcedure

Procedure DoEventResizeWindow()
  ResizeGadget(0, 8, 8, WindowWidth(0) - 16, WindowHeight(0) - 16)  
EndProcedure

If OpenWindow(0, 100, 100, 322, 150, "ContainerGadget", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
  ContainerGadget(0, 8, 8, WindowWidth(0) - 16, WindowHeight(0) - 16, #PB_Container_Raised)
  ButtonGadget(1, 10, 15, 80, 24, "Button 1")
  ButtonGadget(2, 95, 15, 80, 24, "Button 2")
  CloseGadgetList()
  
  BindEvent(#PB_Event_SizeWindow, @DoEventResizeWindow())
  BindGadgetEvent(0, @DoEventContainer())
  
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Fred
Administrator
Administrator
Posts: 16686
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: ContainerGadget

Post by Fred »

I don't understand, every gadget function should work with the ContainerGadget(), or do you mean eventtype ? No functions are specifically listed in the doc page: https://www.purebasic.com/documentation ... adget.html
Post Reply