#PB_Container_InnerWidth; #PB_Container_InnerHeight

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

#PB_Container_InnerWidth; #PB_Container_InnerHeight

Post by mestnyi »

We have an opportunity to get the internal dimensions of the gadget panel and scroll AREA gadget . Take this opportunity and for the gadget container.

Code: Select all

If GadgetType(Gadget) = #PB_GadgetType_Panel
  Width= GetGadgetAttribute(Gadget, #PB_Panel_ItemWidth)
  Height= GetGadgetAttribute(Gadget, #PB_Panel_ItemHeight)
ElseIf GadgetType(Gadget) = #PB_GadgetType_ScrollArea
  Width= GetGadgetAttribute(Gadget, #PB_ScrollArea_InnerWidth)
  Height= GetGadgetAttribute(Gadget, #PB_ScrollArea_InnerHeight)
Else
  CompilerIf #PB_Compiler_OS = #PB_OS_Windows
    Protected RECT.RECT 
    GetClientRect_(GadgetID(Gadget), RECT.RECT)
    Width = GadgetWidth(Gadget)
    Height = GadgetHeight(Gadget)
    Width = Width - ((Width - (RECT\right - RECT\left)) )
    Height = Height - ((Height - (RECT\bottom - RECT\top)) ) 
  CompilerElse
    ; TODO
  CompilerEndIf 
EndIf
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: #PB_Container_InnerWidth; #PB_Container_InnerHeight

Post by Danilo »

+1
Post Reply