Page 1 of 1

#PB_Container_InnerWidth; #PB_Container_InnerHeight

Posted: Tue Mar 15, 2016 6:50 pm
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

Re: #PB_Container_InnerWidth; #PB_Container_InnerHeight

Posted: Wed Mar 16, 2016 7:09 am
by Danilo
+1