mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 21:29:25 +02:00
cocoa: updating drawing processing for cocoa table
git-svn-id: trunk@62732 -
This commit is contained in:
parent
8dda0c3323
commit
965242b45e
@ -78,7 +78,7 @@ type
|
||||
|
||||
isImagesInCell: Boolean;
|
||||
isFirstColumnCheckboxes: Boolean;
|
||||
isCustomDraw : Boolean;
|
||||
isOwnerDraw : Boolean;
|
||||
isDynamicRowHeight: Boolean;
|
||||
CustomRowHeight: Integer;
|
||||
|
||||
@ -97,6 +97,7 @@ type
|
||||
procedure resetCursorRects; override;
|
||||
|
||||
procedure drawRow_clipRect(row: NSInteger; clipRect: NSRect); override;
|
||||
procedure drawRect(dirtyRect: NSRect); override;
|
||||
|
||||
// mouse
|
||||
procedure mouseDown(event: NSEvent); override;
|
||||
@ -510,7 +511,6 @@ var
|
||||
ItemState: TOwnerDrawState;
|
||||
begin
|
||||
inherited;
|
||||
if not isCustomDraw then Exit;
|
||||
if not Assigned(callback) then Exit;
|
||||
ctx := TCocoaContext.Create(NSGraphicsContext.currentContext);
|
||||
try
|
||||
@ -526,6 +526,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCocoaTableListView.drawRect(dirtyRect: NSRect);
|
||||
begin
|
||||
inherited drawRect(dirtyRect);
|
||||
if CheckMainThread and Assigned(callback) then
|
||||
callback.Draw(NSGraphicsContext.currentContext, bounds, dirtyRect);
|
||||
end;
|
||||
|
||||
function TCocoaTableListView.getIndexOfColumn(ACol: NSTableColumn): Integer;
|
||||
var
|
||||
idx : NSUInteger;
|
||||
|
@ -230,7 +230,7 @@ begin
|
||||
list.readOnly := true;
|
||||
//todo:
|
||||
//list.AllowMixedState := TCustomCheckListBox(AWinControl).AllowGrayed;
|
||||
list.isCustomDraw := TCustomCheckListBox(AWinControl).Style in [lbOwnerDrawFixed, lbOwnerDrawVariable];
|
||||
list.isOwnerDraw := TCustomCheckListBox(AWinControl).Style in [lbOwnerDrawFixed, lbOwnerDrawVariable];
|
||||
|
||||
scroll := EmbedInScrollView(list);
|
||||
if not Assigned(scroll) then
|
||||
|
@ -648,6 +648,7 @@ procedure TLCLListBoxCallback.DrawRow(rowidx: Integer; ctx: TCocoaContext;
|
||||
var
|
||||
DrawStruct: TDrawListItemStruct;
|
||||
begin
|
||||
if not listview.isOwnerDraw then Exit;
|
||||
DrawStruct.ItemState := state;
|
||||
DrawStruct.Area := r;
|
||||
DrawStruct.DC := HDC(ctx);
|
||||
@ -2074,7 +2075,7 @@ end;
|
||||
procedure ListBoxSetStyle(list: TCocoaTableListView; AStyle: TListBoxStyle);
|
||||
begin
|
||||
if not Assigned(list) then Exit;
|
||||
list.isCustomDraw := AStyle in [lbOwnerDrawFixed, lbOwnerDrawVariable];
|
||||
list.isOwnerDraw := AStyle in [lbOwnerDrawFixed, lbOwnerDrawVariable];
|
||||
list.isDynamicRowHeight := AStyle = lbOwnerDrawVariable;
|
||||
//todo: if flag isCustomRowHeight changes in runtime
|
||||
// noteHeightOfRowsWithIndexesChanged, should be sent to listview
|
||||
|
Loading…
Reference in New Issue
Block a user