Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002370 [JEDI VCL] 00 JVCL Components feature always 2004-12-10 07:21 2004-12-16 06:37
Reporter anonymous View Status public  
Assigned To
Priority normal Resolution fixed  
Status resolved   Product Version 3.00 BETA
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?
Additional Information
Tags No tags attached.
Attached Files zip file icon JvCtrls041211.zip [^] (12,172 bytes) 2004-12-11 05:55

- Relationships

-  Notes
(0005862)
user72
2004-12-11 05:06

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.
(0005864)
user72
2004-12-11 05:57
edited on: 2004-12-11 05:58

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).

(0005887)
anonymous (viewer)
2004-12-15 10:04

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...
(0005889)
user72
2004-12-15 11:02

Don't worry: I'll commit the changes. I just wanted some feedback on the implementation so it was what you expected :)
(0005898)
user72
2004-12-16 06:37

Comitted to CVS

- Issue History
Date Modified Username Field Change
2004-12-10 07:21 anonymous New Issue
2004-12-11 05:06 user72 Note Added: 0005862
2004-12-11 05:06 user72 Status new => feedback
2004-12-11 05:55 user72 File Added: JvCtrls041211.zip
2004-12-11 05:57 user72 Note Added: 0005864
2004-12-11 05:58 user72 Note Edited: 0005864
2004-12-15 10:04 anonymous Note Added: 0005887
2004-12-15 11:02 user72 Note Added: 0005889
2004-12-16 06:37 user72 Status feedback => resolved
2004-12-16 06:37 user72 Resolution open => fixed
2004-12-16 06:37 user72 Assigned To => user72
2004-12-16 06:37 user72 Note Added: 0005898
2004-12-16 06:37 user72 Assigned To user72 =>


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker