View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002370 | JEDI VCL | 00 JVCL Components | public | 2004-12-10 07:21 | 2004-12-16 06:37 |
Reporter | anonymous | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.00 BETA | ||||
Target Version | Fixed in Version | 3.00 RC 1 | |||
Summary | 0002370: TJvBitBtn and TJvImgBtn missing Flat property | ||||
Description | It would be very nice if both TJvBitBtn and TJvImgBtn would have Flat property. What I actually need is something like TJvArrowButton but wiht ability to take keybord focus (ie TWinControl descendant. perhaps this should be filed as separate feature request?)... It also looks like TJvImgBtn.Alignment doesn't work? | ||||
Tags | No tags attached. | ||||
|
You can use the OwnerDraw/OnButtonDraw property/event of TJvImageBtn to make the button look any way you like. Here's an example on how to draw a button in the standard style: procedure TForm1.JvImgBtn2ButtonDraw(Sender: TObject; const DrawItemStruct: tagDRAWITEMSTRUCT); var Flags:Cardinal;R:TRect; begin Flags := DFCS_BUTTONPUSH or DFCS_ADJUSTRECT; if DrawItemStruct.itemState and ODS_SELECTED <> 0 then Flags := Flags or DFCS_PUSHED R := JvImgBtn2.ClientRect; DrawFrameControl(DrawItemStruct.hDC, R, DFC_BUTTON, Flags); if DrawItemStruct.itemState and ODS_SELECTED <> 0 then OffsetRect(R, 1, 1); DrawText(DrawItemStruct.hDC, PChar(JvImgBtn2.Caption), -1, R, DT_SINGLELINE or DT_CENTER or DT_VCENTER); end; > It also looks like TJvImgBtn.Alignment doesn't work? Works for me. Please provide more info. |
2004-12-11 05:55
|
JvCtrls041211.zip (12,172 bytes) |
|
Try the attached files. Also added a DropArrow property to control whether assigning a DropDownMenu displays an arrow in the button. Only JvImgBtn has been changed (changing JvBitBtn is to much work). |
|
peter - very cool! JvImgBtn now looks as I want. Yes it's true that I could have use OwnerDraw for this but flat look is so common that IMO it makes sense to implement it in the control so that everyone don't have to hand-code it. >> It also looks like TJvImgBtn.Alignment doesn't work? >Works for me. Please provide more info. Now works for me too. Was probably bug in old version... |
|
Don't worry: I'll commit the changes. I just wanted some feedback on the implementation so it was what you expected :) |
|
Comitted to CVS |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-12-10 07:21 | anonymous | New Issue | |
2004-12-11 05:06 |
|
Note Added: 0005862 | |
2004-12-11 05:06 |
|
Status | new => feedback |
2004-12-11 05:55 |
|
File Added: JvCtrls041211.zip | |
2004-12-11 05:57 |
|
Note Added: 0005864 | |
2004-12-11 05:58 |
|
Note Edited: 0005864 | |
2004-12-15 10:04 | anonymous | Note Added: 0005887 | |
2004-12-15 11:02 |
|
Note Added: 0005889 | |
2004-12-16 06:37 |
|
Status | feedback => resolved |
2004-12-16 06:37 |
|
Resolution | open => fixed |
2004-12-16 06:37 |
|
Assigned To | => user72 |
2004-12-16 06:37 |
|
Note Added: 0005898 | |
2004-12-16 06:37 |
|
Assigned To | user72 => |