41 if (!pEl->IsExternalDrawDialog())
43 if (pEl->GetDialogWindow())
44 pEl->GetDialogWindow()->RequestUpdate();
96 if (pChild->
pParent !=
this)
return;
109 if (pChild->
pParent !=
this)
return;
129 assert(pChild->
pNext != pChild);
130 assert(pChild->
pPrev != pChild);
131 assert(pChild->
pParent != pChild);
137 if (!pChild || pChild->
pParent !=
this)
return;
145 assert(pChild->
pNext != pChild);
146 assert(pChild->
pPrev != pChild);
147 assert(pChild->
pParent != pChild);
153 if (!pInsertBefore) {
AddElement(pChild);
return; }
155 if (!pChild || pInsertBefore->
pParent !=
this)
return;
163 pChild->
pNext = pInsertBefore; pInsertBefore->
pPrev = pChild;
166 assert(pChild->
pNext != pChild);
167 assert(pChild->
pPrev != pChild);
168 assert(pChild->
pParent != pChild);
176 if (pPrevElement ==
this)
return nullptr;
189 if (!pPrevElement)
return this;
194 while (pPrevElement && pPrevElement !=
this)
196 if ((pEl = pPrevElement->
pNext))
return pEl;
197 pPrevElement = pPrevElement->
pParent;
218 if (pEl->OnHotkey(cHotkey))
return true;
243 if (pC ==
this)
return true;
284 if (pChild->fVisible && pChild->GetBounds().Contains(iX, iY))
287 pChild->MouseInput(rMouse, iButton, iX - pChild->GetBounds().
x, iY - pChild->GetBounds().y, dwKeyParam);
303 int clx1, cly1, clx2, cly2;
379 int32_t iMaxWinScroll = iClientHgt - iVisHgt;
384 iScrollPos = Clamp<int32_t>(iMaxBarScroll * iWinScroll / iMaxWinScroll, 0, iMaxBarScroll);
398 if (!iMaxBarScroll) iMaxBarScroll=1;
407 int32_t iMaxWinScroll = iClientHgt - iVisHgt;
410 int32_t iNewWinScroll = Clamp<int32_t>(iMaxWinScroll *
iScrollPos / iMaxBarScroll, 0, iMaxWinScroll);
412 if (iWinScroll != iNewWinScroll)
505 :
Window(), pScrollBar(nullptr), iScrollY(0), iClientHeight(0), fHasBar(true), iFrozen(0)
509 rtBounds.
x = rtBounds.
y = 0;
516 if (pParentWindow !=
this)
548 int32_t iMaxScroll = iClientHgt - iVisHgt;
568 int32_t iMaxScroll = iClientHgt - iVisHgt;
569 int iNewScrollY = Clamp<int>(
iScrollY + iAmount, 0, iMaxScroll);
596 if (!iHgt) iHgt = iVisHgt;
619 rtBounds.
x = rtBounds.
y = 0;
640 if (!noAutomaticPositioning)
649 short iDelta = (short)(dwKeyParam >> 16);
661 CStdFont *GroupBox::GetTitleFont()
const
670 if (dwBackClr != 0xffffffff)
675 int32_t iBorderYOff = 0;
676 int32_t iTitleGapX = 0;
677 int32_t iTitleGapWdt = 0;
680 CStdFont *pTitleFont = GetTitleFont();
683 iTitleGapX = 7; iTitleGapWdt += 4;
692 for (
int i=0; i<2; ++i)
695 pDraw->
DrawLineDw(cgo.
Surface, (
float) (x1+2), (
float)(y1+i), (
float)(x1+iTitleGapX), (
float)(y1+i), dwFrameClr);
696 pDraw->
DrawLineDw(cgo.
Surface, (
float) (x1+iTitleGapX+iTitleGapWdt), (
float)(y1+i), (
float)(x2-3), (
float)(y1+i), dwFrameClr);
698 pDraw->
DrawLineDw(cgo.
Surface, (
float) (x1+2), (
float)(y2-1-i), (
float)(x2-3), (
float)(y2-1-i), dwFrameClr);
760 if (!pDlg)
return true;
C4GraphicsResource GraphicsResource
#define C4GUI_ScrollArrowHgt
#define C4GUI_ScrollBarWdt
#define C4GUI_ScrollThumbWdt
#define C4GUI_ScrollThumbHgt
#define C4GUI_ScrollBarHgt
#define C4GUI_ScrollArrowWdt
const int32_t C4MC_Button_LeftDown
const int32_t C4MC_Button_Wheel
bool SubPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
void DrawFrameDw(C4Surface *sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr, float width=1.0f)
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
bool GetPrimaryClipper(int &rX1, int &rY1, int &rX2, int &rY2)
void DrawLineDw(C4Surface *sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr, float width=1.0f)
bool SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
void ApplyZoom(float &X, float &Y)
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
void Draw(C4Facet &cgo, bool fAspect=true, int32_t iPhaseX=0, int32_t iPhaseY=0, bool fTransparent=true)
void DoCall(class Element *pElement) override
void AddElement(Element *pChild)
void RemoveElement(Element *pChild) override
Element * GetElementByIndex(int32_t i)
void MakeLastElement(Element *pChild)
int32_t GetElementCount()
void ReaddElement(Element *pChild)
virtual void AfterElementRemoval()
void InsertElement(Element *pChild, Element *pInsertBefore)
bool OnHotkey(uint32_t cHotkey) override
Element * GetNextNestedElement(Element *pPrevElement, bool fBackwards)
void Draw(C4TargetFacet &cgo) override
void SetVisibility(bool fToValue) override
bool IsParentOf(Element *pEl) override
friend class ScrollWindow
Element * GetFirstNestedElement(bool fBackwards) override
Control(const C4Rect &rtBounds)
Control * IsFocusElement() override
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
virtual bool IsFocusOnClick()
void SetFocus(Control *pCtrl, bool fByMouse)
bool IsActive(bool fForKeyboard)
void AdvanceFocus(bool fBackwards)
virtual void DrawElement(C4TargetFacet &cgo)
virtual bool IsOwnPtrElement()
Element * GetPrev() const
virtual void SetVisibility(bool fToValue)
virtual void RemoveElement(Element *pChild)
void DrawVBar(C4TargetFacet &cgo, DynBarFacet &rFacets)
virtual Screen * GetScreen()
C4Rect GetContainedClientRect()
virtual void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
void SetBounds(const C4Rect &rcNewBound)
void DrawHBarByVGfx(C4TargetFacet &cgo, DynBarFacet &rFacets)
virtual class Dialog * GetDlg()
virtual Element * GetFirstNestedElement(bool fBackwards)
virtual Element * GetFirstContained()
virtual void MouseLeave(CMouse &rMouse)
void Draw3DFrame(C4TargetFacet &cgo, bool fUp=false, int32_t iIndent=1, BYTE byAlpha=C4GUI_BorderAlpha, bool fDrawTop=true, int32_t iTopOff=0, bool fDrawLeft=true, int32_t iLeftOff=0)
virtual void UpdateOwnPos()
void DrawElement(C4TargetFacet &cgo) override
virtual int32_t GetMarginRight()
virtual int32_t GetMarginTop()
void UpdateOwnPos() override
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
virtual int32_t GetMarginLeft()
void Draw(C4TargetFacet &cgo) override
C4Rect & GetClientRect() override
virtual int32_t GetMarginBottom()
virtual bool IsComponentOutsideClientArea()
C4GUI::ScrollBarFacets sfctScroll
void Set(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
int GetLineHeight() const
bool GetTextExtent(const char *szText, int32_t &rsx, int32_t &rsy, bool fCheckMarkup=true)
const char * getData() const
void GUISound(const char *szSound)