1 year ago
#207027
Max Kielland
TCategoryPanelGroup not repainting Panels on collapse when using styles
I'm using the style "Charcoal Dark Slate" right out of the box and having issues with the TCategoryPanelGroup
not refreshing its category panels.
In this setup all category panels all expanded.
Each panel has ONE control, a TFrame
with a few child controls. The TFrame
has its Align
property set to alClient
.
If I collapse the middle one, every following panel isn't redrawing all controls. I have to move the mouse over them to get them redrawn. If I collapse the first panel, panel 2 and 3 aren't redrawn etc... (basically all panels that moved up)
I have tried to Invalidate()
, Repaint()
and Refresh()
the TCategoryPanelGroup
on the collapse event OnCollapse
. I have also tried to Invalidate()
, Repaint()
and Refresh()
the panel itself in desperation. Nothing helps.
I noticed that all panels are repainted on resize. My workaround now is to have the OnCollapse
and OnExpand
event handlers to quickly resize the TCategoryPanelGroup
control.
void __fastcall TGraph_Form::CategoryPanelCollapse(TObject *Sender) {
TCategoryPanel *p = reinterpret_cast<TCategoryPanel*>(Sender);
TCategoryPanelGroup *g = reinterpret_cast<TCategoryPanelGroup*>(p->PanelGroup);
// Fix style bug on collapse events
// Force a resize to redraw all panels
g->Width++;
g->Width--;
}
Adjusting the Height
property of the TCategoryPanelGroup
will not force all panels to redraw, it has to be the Width
property.
Have I missed something here or is this indeed another VCL style bug?
themes
vcl
vcl-styles
c++builder-10.4-sydney
0 Answers
Your Answer