summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa946f8)
raw | patch | inline | side by side (parent: fa946f8)
author | binarymaster <x86corez@gmail.com> | |
Tue, 26 Sep 2017 20:18:56 +0000 (23:18 +0300) | ||
committer | binarymaster <x86corez@gmail.com> | |
Tue, 26 Sep 2017 20:18:56 +0000 (23:18 +0300) |
src/editor/f_main.lfm | patch | blob | history | |
src/editor/f_main.pas | patch | blob | history | |
src/engine/e_graphics.pas | patch | blob | history |
diff --git a/src/editor/f_main.lfm b/src/editor/f_main.lfm
index d35946313f732d2b62f4064ef5577e59885b3f97..e404cfab854920de9f99980430b5a18066ee2c03 100644 (file)
--- a/src/editor/f_main.lfm
+++ b/src/editor/f_main.lfm
Constraints.MinHeight = 70
ItemHeight = 13
OnClick = lbTextureListClick
+ OnDrawItem = lbTextureListDrawItem
Style = lbOwnerDrawFixed
TabOrder = 0
end
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 99820355f52210d9bc9db7cdf758a2ec5a50502b..e470131554b89011bafbc09e76c5936672eb5130 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormResize(Sender: TObject);
procedure lbTextureListClick(Sender: TObject);
+ procedure lbTextureListDrawItem(Control: TWinControl; Index: Integer;
+ ARect: TRect; State: TOwnerDrawState);
procedure RenderPanelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure RenderPanelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure RenderPanelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure OnIdle(Sender: TObject; var Done: Boolean);
public
procedure RefreshRecentMenu();
- { procedure lbTextureListDrawItem(Control: TWinControl; Index: Integer;
- Rect: TRect; State: TOwnerDrawState); }
end;
const
end;
end;
+procedure TMainForm.lbTextureListDrawItem(Control: TWinControl; Index: Integer;
+ ARect: TRect; State: TOwnerDrawState);
+begin
+ with Control as TListBox do
+ begin
+ if LCLType.odSelected in State then
+ begin
+ Canvas.Brush.Color := clHighlight;
+ Canvas.Font.Color := clHighlightText;
+ end else
+ if (Items <> nil) and (Index >= 0) then
+ if slInvalidTextures.IndexOf(Items[Index]) > -1 then
+ begin
+ Canvas.Brush.Color := clRed;
+ Canvas.Font.Color := clWhite;
+ end;
+ Canvas.FillRect(ARect);
+ Canvas.TextRect(ARect, ARect.Left, ARect.Top, Items[Index]);
+ end;
+end;
+
procedure TMainForm.vleObjectPropertyGetPickList(Sender: TObject;
const KeyName: String; Values: TStrings);
begin
end;
end;
-{
-procedure TMainForm.lbTextureListDrawItem(Control: TWinControl; Index: Integer;
- Rect: TRect; State: LCLType.TOwnerDrawState);
-begin
- with Control as TListBox do
- begin
- if LCLType.odSelected in State then
- begin
- Canvas.Brush.Color := clHighlight;
- Canvas.Font.Color := clHighlightText;
- end else
- if (Items <> nil) and (Index >= 0) then
- if slInvalidTextures.IndexOf(Items[Index]) > -1 then
- begin
- Canvas.Brush.Color := clRed;
- Canvas.Font.Color := clWhite;
- end;
- Canvas.FillRect(Rect);
- Canvas.TextRect(Rect, Rect.Left, Rect.Top, Items[Index]);
- end;
-end;
-}
end.
index 47bf1107eff8781417c7e2f583f11e2201d525ce..c9a16c2dfbfd776b7f4f5526f8f18c08514964d1 100644 (file)
X, Y: Double;
end;
- TRect = record
+ TRectE = record
Left, Top, Right, Bottom: Integer;
end;
PPoint = ^TPoint;
PPoint2f = ^TPoint2f;
- PRect = ^TRect;
+ PRect = ^TRectE;
PRectWH = ^TRectWH;
function _RGB(Red, Green, Blue: Byte): TRGB;
function _Point(X, Y: Integer): TPoint2i;
function _Rect(X, Y: Integer; Width, Height: Word): TRectWH;
-function _TRect(L, T, R, B: LongInt): TRect;
+function _TRect(L, T, R, B: LongInt): TRectE;
//function e_getTextGLId (ID: DWORD): GLuint;
Result.Height := Height;
end;
-function _TRect(L, T, R, B: LongInt): TRect;
+function _TRect(L, T, R, B: LongInt): TRectE;
begin
Result.Top := T;
Result.Left := L;