From: Olivier S. <ob...@us...> - 2004-01-16 14:50:50
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1:/tmp/cvs-serv18342/dev/JVCL3/run Modified Files: JvMenus.pas Log Message: Removed the LeftMargin, will be added in a painter later Index: JvMenus.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvMenus.pas,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** JvMenus.pas 16 Jan 2004 14:26:52 -0000 1.26 --- JvMenus.pas 16 Jan 2004 14:50:46 -0000 1.27 *************** *** 284,288 **** FImages : TImageList; FImageSize : TJvMenuImageSize; ! FLeftMargin : Cardinal; FShowCheckMarks : Boolean; FStyle : TJvMenuStyle; --- 284,288 ---- FImages : TImageList; FImageSize : TJvMenuImageSize; ! // FLeftMargin : Cardinal; FShowCheckMarks : Boolean; FStyle : TJvMenuStyle; *************** *** 292,296 **** FOnDrawItem: TDrawMenuItemEvent; FOnMeasureItem: TMeasureMenuItemEvent; ! FOnDrawMargin: TDrawMarginEvent; FOnGetItemParams: TItemParamsEvent; --- 292,296 ---- FOnDrawItem: TDrawMenuItemEvent; FOnMeasureItem: TMeasureMenuItemEvent; ! // FOnDrawMargin: TDrawMarginEvent; FOnGetItemParams: TItemParamsEvent; *************** *** 358,362 **** property ImageSize : TJvMenuImageSize read FImageSize write FImageSize; property ItemPainter : TJvCustomMenuItemPainter read FJvMenuItemPainter; ! property LeftMargin : Cardinal read FLeftMargin write FLeftMargin default 0; property OwnerDraw stored False; property ShowCheckMarks : Boolean read FShowCheckMarks write FShowCheckMarks default False; --- 358,362 ---- property ImageSize : TJvMenuImageSize read FImageSize write FImageSize; property ItemPainter : TJvCustomMenuItemPainter read FJvMenuItemPainter; ! // property LeftMargin : Cardinal read FLeftMargin write FLeftMargin default 0; property OwnerDraw stored False; property ShowCheckMarks : Boolean read FShowCheckMarks write FShowCheckMarks default False; *************** *** 369,373 **** property OnGetHotImageIndex: TItemImageEvent read FOnGetHotImageIndex write FOnGetHotImageIndex; property OnDrawItem: TDrawMenuItemEvent read FOnDrawItem write FOnDrawItem; ! property OnDrawMargin: TDrawMarginEvent read FOnDrawMargin write FOnDrawMargin; property OnGetItemParams: TItemParamsEvent read FOnGetItemParams write FOnGetItemParams; property OnMeasureItem: TMeasureMenuItemEvent read FOnMeasureItem write FOnMeasureItem; --- 369,373 ---- property OnGetHotImageIndex: TItemImageEvent read FOnGetHotImageIndex write FOnGetHotImageIndex; property OnDrawItem: TDrawMenuItemEvent read FOnDrawItem write FOnDrawItem; ! // property OnDrawMargin: TDrawMarginEvent read FOnDrawMargin write FOnDrawMargin; property OnGetItemParams: TItemParamsEvent read FOnGetItemParams write FOnGetItemParams; property OnMeasureItem: TMeasureMenuItemEvent read FOnMeasureItem write FOnMeasureItem; *************** *** 1561,1565 **** GetBValue(DefMarginColor) div 4)); end; ! end; } procedure TJvPopupMenu.WMDrawItem(var Message: TWMDrawItem); --- 1561,1565 ---- GetBValue(DefMarginColor) div 4)); end; ! end; } procedure TJvPopupMenu.WMDrawItem(var Message: TWMDrawItem); *************** *** 1568,1572 **** SaveIndex: Integer; Item: TMenuItem; ! MarginRect: TRect; begin with Message.DrawItemStruct^ do --- 1568,1572 ---- SaveIndex: Integer; Item: TMenuItem; ! // MarginRect: TRect; begin with Message.DrawItemStruct^ do *************** *** 1580,1584 **** try Canvas.Handle := hDC; ! if (Item.Parent = Self.Items) and (FLeftMargin > 0) then if (itemAction = ODA_DRAWENTIRE) then begin --- 1580,1584 ---- try Canvas.Handle := hDC; ! { if (Item.Parent = Self.Items) and (FLeftMargin > 0) then if (itemAction = ODA_DRAWENTIRE) then begin *************** *** 1586,1591 **** MarginRect.Left := 0; MarginRect.Right := FLeftMargin; ! //DrawMargin(MarginRect); // (ahuser) obones has out commented the DrawMargin method ! end; SetDefaultMenuFont(Canvas.Font); Canvas.Font.Color := clMenuText; --- 1586,1591 ---- MarginRect.Left := 0; MarginRect.Right := FLeftMargin; ! DrawMargin(MarginRect); ! end;} SetDefaultMenuFont(Canvas.Font); Canvas.Font.Color := clMenuText; *************** *** 1599,1604 **** Canvas.Font.Color := clHighlightText; end; ! if (Item.Parent = Self.Items) then ! Inc(rcItem.Left, LeftMargin + 1); with rcItem do IntersectClipRect(Canvas.Handle, Left, Top, Right, Bottom); --- 1599,1604 ---- Canvas.Font.Color := clHighlightText; end; ! { if (Item.Parent = Self.Items) then ! Inc(rcItem.Left, LeftMargin + 1);} with rcItem do IntersectClipRect(Canvas.Handle, Left, Top, Right, Bottom); *************** *** 1629,1634 **** FJvMenuItemPainter.Measure(Item, Integer(itemWidth), Integer(itemHeight)); MeasureItem(Item, Integer(itemWidth), Integer(itemHeight)); ! if (Item.Parent = Self.Items) then ! Inc(itemWidth, LeftMargin + 1); finally ReleaseDC(0, Canvas.Handle); --- 1629,1634 ---- FJvMenuItemPainter.Measure(Item, Integer(itemWidth), Integer(itemHeight)); MeasureItem(Item, Integer(itemWidth), Integer(itemHeight)); ! { if (Item.Parent = Self.Items) then ! Inc(itemWidth, LeftMargin + 1);} finally ReleaseDC(0, Canvas.Handle); |