View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004398 | JEDI VCL | 00 JVCL Components | public | 2008-07-09 01:55 | 2009-05-03 10:50 |
Reporter | ZENsan | Assigned To | AHUser | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | 3.37 | |||
Summary | 0004398: TJvCpationButton does not work correctly in Windows Vista | ||||
Description | TJvCpationButton does not work correctly in Windows Vista. | ||||
Tags | No tags attached. | ||||
2008-07-09 01:55
|
|
|
Please provide the zipped sources of a sample application showing this. |
2008-07-15 23:35
|
Project1.rar (747 bytes) |
|
I have found, that in UpdateButtonRect before: { Click rect is a bit bigger } we should decrease by about 50 pixels: FButtonRect.Left := FButtonRect.Left - 50; FButtonRect.Right := FButtonRect.Right - 50; Then when run application and RESIZE main window, caption button WILL BE VISIBLE, but window's caption bar will not be semi-transparent (in Vista Aero theme). |
|
I have found a method to get it working on Vista with themes. The button was not visible because in HandleNCPaintBefore: if RectInRegion(FSaveRgn, LButtonRect) then ... ALWAYS was false, before we do not resize the form. So I added: uses ... JclSysInfo; TJvCaptionButton = class(TJvComponent) private { Properties } FForceRedraw: Boolean; //NEW constructor TJvCaptionButton.Create(AOwner: TComponent); ... if (GetWindowsVersion >= wvWinVista) and IsThemed then //NEW FForceRedraw := true; procedure TJvCaptionButton.HandleNCPaintBefore(Wnd: THandle; var Msg: TWMNCPaint); ... if RectInRegion(FSaveRgn, LButtonRect) or FForceRedraw {NEW} then begin FForceRedraw := False;//NEW Also button size was not calculated correctly. We have to change procedure TJvCaptionButton.CalcDefaultButtonRect(Wnd: THandle); ... { 3. Calc FDefaultButtonWidth } {$IFDEF JVCLThemesEnabled} if IsThemed then begin if (GetWindowsVersion >= wvWinVista) then // NEW FDefaultButtonWidth := GetSystemMetrics(SM_CXSIZE) - 4 //I'm not sure but I haven't found any better metrics //WM_GETTITLEBARINFOEX probably would be better else FDefaultButtonWidth := FDefaultButtonHeight; end Now the button IS WORKING. At the beginning (when we show the form) it flickers once, but the rest is OK. If anybody could fix it that would be nice :-) |
|
WM_GETTITLEBARINFOEX does't work because the window is switch back to the "Basic" style but WM_GETTITLEBARINFOEX will return the "Glass" style coordinates. |
|
Fixed in SVN. |
Date Modified | Username | Field | Change |
---|---|---|---|
2008-07-09 01:55 | ZENsan | New Issue | |
2008-07-09 01:55 | ZENsan | File Added: Untitled.png | |
2008-07-15 00:59 | obones | Note Added: 0014377 | |
2008-07-15 00:59 | obones | Status | new => feedback |
2008-07-15 23:35 | ZENsan | File Added: Project1.rar | |
2008-07-21 00:24 | obones | Status | feedback => acknowledged |
2008-07-23 07:20 | obones | Relationship added | has duplicate 0004323 |
2009-04-16 18:00 | bartmichael | Note Added: 0015423 | |
2009-05-01 19:10 | bartmichael | Note Added: 0015507 | |
2009-05-03 10:43 | AHUser | Note Added: 0015509 | |
2009-05-03 10:43 | AHUser | Note Edited: 0015509 | |
2009-05-03 10:50 | AHUser | Note Added: 0015510 | |
2009-05-03 10:50 | AHUser | Status | acknowledged => resolved |
2009-05-03 10:50 | AHUser | Fixed in Version | => Daily / SVN |
2009-05-03 10:50 | AHUser | Resolution | open => fixed |
2009-05-03 10:50 | AHUser | Assigned To | => AHUser |