TLabel is not updated overlapped with TPanel - c++builder

My environment:
VCL application developped on RadStudio XE4 on Windows 7 pro (32bit).
tested on Windows 7 pro (32bit).
I found some strange behavior of software produced using RadStudio XE4.
Strings of TLabel placed over TPanel is not updated correctly.
The simplest example of this is shown as the picture. In this software, TLabel shows current time for every second. As shown in the picture, the lower part (which is on TPanel) is not updated unless I put window of other software overlapped on the TPanel component.
Is this normal behavior for RadStudio? Or some bugs in the RadStudio?
If there is some workaround, I would like to know.

TLabel is a TGraphicControl descendant. TPanel is a TWinControl descendant. A TGraphicControl renders on the HDC of its Parent window, not on other child controls of the same Parent. When the TLabel is updated, it triggers a repaint of its Parent but not of the TPanel. To force that repaint, call the TPanel's Update() or Invalidate() method whenever you make changes to the TLabel.

Related

Form.PixelsPerInch no longer used in Delphi Tokyo

In older Delphi's (for example Delphi XE4), it is clear what the Form.PixelsPerInch property is for. If I change this property and save the form, close and then reload it, all controls and fonts on the form will be resized accordingly.
However, in Delphi Tokyo (maybe since Seattle) making such a change has no effect on the controls on the form, and seems to serve no purpose.
Is this correct?
If Delphi Tokyo is not using the PixelsPerInch property I wonder how it can correctly scale the form at different DPI's..

How to paint all VCL Styles tab sheet controls to a given canvas when the tab is not visible to the user?

Using C++ Builder 10.2, VCL & VCL Styles...
I have a TPageControl that has TFrames on each of its TTabsheets. One of these frames contains some TEdit controls that show data read from a device. After the reading is acquired and the frame is updated, the system may create a screenshot of this frame and store it in a jpeg file.
Since the TTabsheet in the TPageControl with the TEdit controls may not be visible when the jpeg is created, the jpeg may not have the text contents of the TEdit controls painted. This has given me fits.
I have found that by using a TStaticText that is styled, the text appears in the jpeg. This seems to be due to the fact that TStaticTextStyleHook.Paint (in VCL.StdCtrls.pas) draws the control itself rather than letting Windows do it.
There are two problems with using TStaticText. Selecting the SystemStyle choice (Windows) causes TStaticTextStyleHook.Paint to skip painting the control itself and delegates to Windows (I think). Also, the appearance of TStaticText isn't exactly what I want, but I may have to live with it.
Is Windows refusing to paint TEdit control contents because the parent is not Visible?
Is there a way to force Windows to paint the TEdit controls in this situation?
UpdateWindow() and RedrawWindow() does not work.

TPanel in Embarcadero Rad Studio

I have a TMapView. Above the TPanel. Problem is that the map visible through the TPanel. How to make background non-transparent for TPanel
There are no way to show panel (or any other styled FMX control) on the TMapView, TWebBrowser, other controls with ControlType = Platform (like TEdit) on mobile platforms.
TMapView is a wrapper around native control. Native controls always shown on top of form because of differences in the mechanism of rendering. Like in VCL, TEdit always displayed above TLabel, because TEdit is descendant of TCustomControl, which painting controlled by OS, and TLabel is descendant of TGraphicControl, which painting controlled by form.
If you want to show some controls above TMapView/TWebBrowser, etc..., you should use only native controls.
a good explanation is given on http://www.tmssoftware.com/site/fmxicl.asp

TPagecontrol equivalent for Firemonkey

while changing software development from VCL frame work to Firemonkey, I can not understand where is the TPagecontrol component gone from the good old VCL framework.
I already placed a TTabControl on my Form and added several Tabitemn, bit now I can not find the replacement for the TPagecontrol.
You can take Firemonkey's TTabControl as a replacement for VCL's TPageControl. Their tabs are containers just like everything else in Firemonkey (so unlike the VCL's TTabControl their tabs are real containers).

How do I make dockable forms like the IDE's without the very slow freezing movement of the dockable form?

How do I do the IDE method or eventually make the basic dock method without the very slow freezing movement of the dockable form?
When I Googled for dockable forms in Delphi and found a post by Zibadian on Programmers Heaven:
First off: The windows in the Delphi IDE aren't MDI forms, by SDI forms.
Now to create a dockable window.
Form2 will be dockable and Form1 will be the place to dock it to. Place a control (such as a TPanel) on Form1 to serve a DockSite. Make sure that you set the DockSite and the UseDockManager properties to true for that control.
For Form2 set the DragKind to dkDrop, the DragMode to dmAutomatic and UseDockManager to true.
That was the basic dock function. If you run your program, show the Form2 and drag that form over the docksite, it should dock at that site. You can even undock it by grabbing the "caption" as you have seen in the IDE.
For me, that method moves the dockable form very slowly. However, Zibadian's answer continues to describe how the IDE does it instead:
The dock-method of the IDE is a little more complex, since you don't see the docksite. I think, you need to write a Form1.OnDockOver or Form1.OnDockDrop to perform that. That (Those) event(s) need to show the docksite at the appropriate location.
Have a look at the Using the TDockTabSet component article by Jeremy North. It is a few years old but should give you some helpful pointers.
Try the JVCL Docking library

Resources