mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 17:29:40 +02:00
moved compiler options to project menu, added -CX for smartlinking
git-svn-id: trunk@5217 -
This commit is contained in:
parent
3db332ae2e
commit
b65e8867cf
@ -97,7 +97,7 @@ type
|
||||
|
||||
TCommentStyle = (CommentNone, CommentTP, CommentOldTP, CommentDelphi);
|
||||
|
||||
TCompilerMode = (cmFPC, cmDELPHI, cmGPC, cmTP, cmOBJFPC);
|
||||
TCompilerMode = (cmFPC, cmDELPHI, cmGPC, cmTP, cmOBJFPC, cmMac);
|
||||
TPascalCompiler = (pcFPC, pcDelphi);
|
||||
|
||||
{ TMissingIncludeFile is a missing include file together with all
|
||||
@ -443,7 +443,7 @@ const
|
||||
|
||||
const
|
||||
CompilerModeNames: array[TCompilerMode] of shortstring=(
|
||||
'FPC', 'DELPHI', 'GPC', 'TP', 'OBJFPC'
|
||||
'FPC', 'DELPHI', 'GPC', 'TP', 'OBJFPC', 'MAC'
|
||||
);
|
||||
PascalCompilerNames: array[TPascalCompiler] of shortstring=(
|
||||
'FPC', 'DELPHI'
|
||||
|
@ -1980,7 +1980,7 @@ Processor specific options:
|
||||
case (LinkStyle) of
|
||||
1: switches := switches + ' -XD';
|
||||
2: switches := switches + ' -XS';
|
||||
3: switches := switches + ' -XX';
|
||||
3: switches := switches + ' -XX -CX';
|
||||
end;
|
||||
|
||||
// additional Linker options
|
||||
|
@ -1748,7 +1748,7 @@ resourcestring
|
||||
lisDiskDiffChangedFiles = 'Changed files:';
|
||||
lisDiskDiffClickOnOneOfTheAboveItemsToSeeTheDiff = 'Click on one of the '
|
||||
+'above items to see the diff';
|
||||
lisDiskDiffRevertAll = 'Revert All';
|
||||
lisDiskDiffRevertAll = 'Reload from disk';
|
||||
lisDiskDiffIgnoreDiskChanges = 'Ignore disk changes';
|
||||
|
||||
// edit define tree
|
||||
|
@ -1614,11 +1614,12 @@ begin
|
||||
itmProjectSaveAs.OnClick := @mnuSaveProjectAsClicked;
|
||||
itmProjectPublish.OnClick := @mnuPublishProjectClicked;
|
||||
itmProjectInspector.OnClick := @mnuProjectInspectorClicked;
|
||||
itmProjectOptions.OnClick := @mnuProjectOptionsClicked;
|
||||
itmProjectCompilerOptions.OnClick := @mnuProjectCompilerSettingsClicked;
|
||||
itmProjectAddTo.OnClick := @mnuAddToProjectClicked;
|
||||
itmProjectRemoveFrom.OnClick := @mnuRemoveFromProjectClicked;
|
||||
itmProjectViewSource.OnClick := @mnuViewProjectSourceClicked;
|
||||
itmProjectViewToDos.OnClick := @mnuViewProjectTodosClicked;
|
||||
itmProjectOptions.OnClick := @mnuProjectOptionsClicked;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.SetupRunMenu;
|
||||
@ -1634,7 +1635,6 @@ begin
|
||||
itmRunMenuStepOver.OnClick := @mnuStepOverProjectClicked;
|
||||
itmRunMenuRunToCursor.OnClick := @mnuRunToCursorProjectClicked;
|
||||
itmRunMenuStop.OnClick := @mnuStopProjectClicked;
|
||||
itmRunMenuCompilerSettings.OnClick := @mnuProjectCompilerSettingsClicked;
|
||||
itmRunMenuRunParameters.OnClick := @mnuRunParametersClicked;
|
||||
itmRunMenuBuildFile.OnClick := @mnuBuildFileClicked;
|
||||
itmRunMenuRunFile.OnClick := @mnuRunFileClicked;
|
||||
@ -10335,6 +10335,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.712 2004/02/21 15:37:32 mattias
|
||||
moved compiler options to project menu, added -CX for smartlinking
|
||||
|
||||
Revision 1.711 2004/02/17 22:17:39 mattias
|
||||
accelerated conversion from data to lrs
|
||||
|
||||
|
@ -290,12 +290,12 @@ type
|
||||
itmProjectViewSource: TMenuItem;
|
||||
itmProjectViewToDos: TMenuItem;
|
||||
itmProjectOptions: TMenuItem;
|
||||
itmProjectCompilerOptions: TMenuItem;
|
||||
|
||||
// run menu
|
||||
itmRunMenuBuild: TMenuItem;
|
||||
itmRunMenuBuildAll: TMenuItem;
|
||||
itmRunMenuAbortBuild: TMenuItem;
|
||||
itmRunMenuCompilerSettings: TMenuItem;
|
||||
itmRunMenuRun: TMenuItem;
|
||||
itmRunMenuPause: TMenuItem;
|
||||
itmRunMenuStepInto: TMenuItem;
|
||||
@ -1119,9 +1119,19 @@ begin
|
||||
itmProjectInspector.Name:='itmProjectInspector';
|
||||
itmProjectInspector.Caption := lisMenuProjectInspector;
|
||||
itmProjectInspector.Bitmap.LoadFromLazarusResource('menu_projectinspector');
|
||||
{$IFNDEF DisablePkgs}
|
||||
|
||||
itmProjectOptions := TMenuItem.Create(Self);
|
||||
itmProjectOptions.Name:='itmProjectOptions';
|
||||
itmProjectOptions.Caption := lisMenuProjectOptions;
|
||||
itmProjectOptions.Bitmap.LoadFromLazarusResource('menu_projectoptions');
|
||||
mnuProject.Add(itmProjectOptions);
|
||||
|
||||
itmProjectCompilerOptions := TMenuItem.Create(Self);
|
||||
itmProjectCompilerOptions.Name:='itmProjectCompilerOptions';
|
||||
itmProjectCompilerOptions.Caption := lisMenuCompilerOptions;
|
||||
mnuRun.Add(itmProjectCompilerOptions);
|
||||
|
||||
mnuProject.Add(itmProjectInspector);
|
||||
{$ENDIF}
|
||||
|
||||
itmProjectAddTo := TMenuItem.Create(Self);
|
||||
itmProjectAddTo.Name:='itmProjectAddTo';
|
||||
@ -1144,14 +1154,6 @@ begin
|
||||
itmProjectViewToDos.Name:='itmProjectViewToDos';
|
||||
itmProjectViewToDos.Caption := lisMenuViewProjectTodos;
|
||||
mnuProject.Add(itmProjectViewToDos);
|
||||
|
||||
mnuProject.Add(CreateMenuSeparator);
|
||||
|
||||
itmProjectOptions := TMenuItem.Create(Self);
|
||||
itmProjectOptions.Name:='itmProjectOptions';
|
||||
itmProjectOptions.Caption := lisMenuProjectOptions;
|
||||
itmProjectOptions.Bitmap.LoadFromLazarusResource('menu_projectoptions');
|
||||
mnuProject.Add(itmProjectOptions);
|
||||
end;
|
||||
|
||||
procedure TMainIDEBar.SetupRunMenu;
|
||||
@ -1173,11 +1175,6 @@ begin
|
||||
itmRunMenuAbortBuild.Caption := lisMenuAbortBuild;
|
||||
mnuRun.Add(itmRunMenuAbortBuild);
|
||||
|
||||
itmRunMenuCompilerSettings := TMenuItem.Create(Self);
|
||||
itmRunMenuCompilerSettings.Name:='itmRunMenuCompilerSettings';
|
||||
itmRunMenuCompilerSettings.Caption := lisMenuCompilerOptions;
|
||||
mnuRun.Add(itmRunMenuCompilerSettings);
|
||||
|
||||
mnuRun.Add(CreateMenuSeparator);
|
||||
|
||||
itmRunMenuRun := TMenuItem.Create(Self);
|
||||
@ -1516,10 +1513,11 @@ begin
|
||||
itmProjectSaveAs.ShortCut:=CommandToShortCut(ecSaveProjectAs);
|
||||
itmProjectPublish.ShortCut:=CommandToShortCut(ecPublishProject);
|
||||
itmProjectInspector.ShortCut:=CommandToShortCut(ecProjectInspector);
|
||||
itmProjectOptions.ShortCut:=CommandToShortCut(ecProjectOptions);
|
||||
itmProjectCompilerOptions.ShortCut:=CommandToShortCut(ecCompilerOptions);
|
||||
itmProjectAddTo.ShortCut:=CommandToShortCut(ecAddCurUnitToProj);
|
||||
itmProjectRemoveFrom.ShortCut:=CommandToShortCut(ecRemoveFromProj);
|
||||
itmProjectViewSource.ShortCut:=CommandToShortCut(ecViewProjectSource);
|
||||
itmProjectOptions.ShortCut:=CommandToShortCut(ecProjectOptions);
|
||||
|
||||
// run menu
|
||||
itmRunMenuBuild.ShortCut:=CommandToShortCut(ecBuild);
|
||||
@ -1532,7 +1530,6 @@ begin
|
||||
itmRunMenuRunToCursor.ShortCut:=CommandToShortCut(ecRunToCursor);
|
||||
itmRunMenuStop.ShortCut:=CommandToShortCut(ecStopProgram);
|
||||
itmRunMenuResetDebugger.ShortCut:=CommandToShortCut(ecResetDebugger);
|
||||
itmRunMenuCompilerSettings.ShortCut:=CommandToShortCut(ecCompilerOptions);
|
||||
itmRunMenuRunParameters.ShortCut:=CommandToShortCut(ecRunParameters);
|
||||
itmRunMenuBuildFile.ShortCut:=CommandToShortCut(ecBuildFile);
|
||||
itmRunMenuRunFile.ShortCut:=CommandToShortCut(ecRunFile);
|
||||
|
@ -788,7 +788,7 @@ type
|
||||
|
||||
TToolBar = class;
|
||||
|
||||
TToolButton = class(TGraphicControl)
|
||||
TToolButton = class(TCustomControl)
|
||||
private
|
||||
FAllowAllUp: Boolean;
|
||||
FDown: Boolean;
|
||||
@ -802,13 +802,11 @@ type
|
||||
FStyle: TToolButtonStyle;
|
||||
FUpdateCount: Integer;
|
||||
FWrap: Boolean;
|
||||
function CalculateButtonState: Word;
|
||||
function GetIndex: Integer;
|
||||
function IsCheckedStored: Boolean;
|
||||
function IsImageIndexStored: Boolean;
|
||||
function IsWidthStored: Boolean;
|
||||
procedure SetAutoSize(const Value: Boolean); Override;
|
||||
procedure SetButtonState(State: Word);
|
||||
procedure SetDown(Value: Boolean);
|
||||
procedure SetDropdownMenu(Value: TPopupMenu);
|
||||
procedure SetGrouped(Value: Boolean);
|
||||
@ -929,7 +927,6 @@ type
|
||||
procedure HotImageListChange(Sender: TObject);
|
||||
procedure UpdateVisibleBar;
|
||||
protected
|
||||
procedure AlignControls(AControl: TControl; var Rect: TRect); override;
|
||||
function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; override;
|
||||
procedure CancelMenu; dynamic;
|
||||
//procedure ChangeScale(M, D: Integer); override;
|
||||
@ -937,6 +934,7 @@ type
|
||||
procedure ClickButton(Button: TToolButton); dynamic;
|
||||
procedure CreateParams(var Params: TCreateParams); override;
|
||||
procedure CreateWnd; override;
|
||||
procedure ControlsAligned; override;
|
||||
function FindButtonFromAccel(Accel: Word): TToolButton;
|
||||
procedure InitMenu(Button: TToolButton); dynamic;
|
||||
procedure Loaded; override;
|
||||
@ -2234,6 +2232,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.110 2004/02/21 15:37:33 mattias
|
||||
moved compiler options to project menu, added -CX for smartlinking
|
||||
|
||||
Revision 1.109 2004/02/13 15:49:54 mattias
|
||||
started advanced LCL auto sizing
|
||||
|
||||
|
@ -789,12 +789,13 @@ type
|
||||
procedure DoAutoSize; Virtual;
|
||||
procedure SetAlign(Value: TAlign); virtual;
|
||||
procedure SetAnchors(const AValue: TAnchors); virtual;
|
||||
procedure SetAutoSize(const Value : Boolean); virtual;
|
||||
procedure SetAutoSize(const Value: Boolean); virtual;
|
||||
procedure BoundsChanged; dynamic;
|
||||
procedure DoConstraintsChange(Sender: TObject); virtual;
|
||||
procedure DoBorderSpacingChange(Sender: TObject); virtual;
|
||||
procedure SendMoveSizeMessages(SizeChanged, PosChanged: boolean); virtual;
|
||||
procedure ConstrainedResize(var MinWidth, MinHeight, MaxWidth, MaxHeight : TConstraintSize); virtual;
|
||||
procedure ConstrainedResize(var MinWidth, MinHeight,
|
||||
MaxWidth, MaxHeight: TConstraintSize); virtual;
|
||||
procedure DoOnResize; virtual;
|
||||
procedure DoOnChangeBounds; virtual;
|
||||
procedure Resize; virtual;
|
||||
@ -855,7 +856,8 @@ type
|
||||
procedure TripleClick; dynamic;
|
||||
procedure QuadClick; dynamic;
|
||||
procedure DoStartDrag(var DragObject: TDragObject); dynamic;
|
||||
procedure DragOver(Source: TObject; X,Y : Integer; State : TDragState; var Accept:Boolean); dynamic;
|
||||
procedure DragOver(Source: TObject; X,Y: Integer; State: TDragState;
|
||||
var Accept:Boolean); dynamic;
|
||||
procedure DragCanceled; dynamic;
|
||||
procedure DoEndDrag(Target: TObject; X,Y : Integer); dynamic;
|
||||
procedure InvalidateControl(IsVisible, IsOpaque : Boolean);
|
||||
@ -950,11 +952,11 @@ type
|
||||
procedure Repaint; virtual;
|
||||
Procedure Invalidate; virtual;
|
||||
procedure AddControl; virtual;
|
||||
Procedure DragDrop(Source: TObject; X,Y : Integer); Dynamic;
|
||||
Procedure DragDrop(Source: TObject; X,Y: Integer); Dynamic;
|
||||
procedure SendToBack;
|
||||
procedure SetBounds(aLeft, aTop, aWidth, aHeight : integer); virtual;
|
||||
procedure SetInitialBounds(aLeft, aTop, aWidth, aHeight : integer); virtual;
|
||||
procedure SetBoundsKeepBase(aLeft, aTop, aWidth, aHeight : integer;
|
||||
procedure SetBounds(aLeft, aTop, aWidth, aHeight: integer); virtual;
|
||||
procedure SetInitialBounds(aLeft, aTop, aWidth, aHeight: integer); virtual;
|
||||
procedure SetBoundsKeepBase(aLeft, aTop, aWidth, aHeight: integer;
|
||||
Lock: boolean); virtual;
|
||||
function GetTextBuf(Buffer: PChar; BufSize: Integer): Integer; virtual;
|
||||
Procedure SetTextBuf(Buffer : PChar); virtual;
|
||||
@ -1265,7 +1267,9 @@ type
|
||||
function GetActionLinkClass: TControlActionLinkClass; override;
|
||||
procedure AdjustSize; override;
|
||||
procedure AdjustClientRect(var Rect: TRect); virtual;
|
||||
procedure AlignControls(AControl : TControl; var ARect: TRect); virtual;
|
||||
procedure AlignControls(AControl: TControl; var ARect: TRect); virtual;
|
||||
function DoAlignChildControls(TheAlign: TAlign; AControl: TControl;
|
||||
AControlList: TList; var ARect: TRect): Boolean; virtual;
|
||||
procedure DoChildSizingChange(Sender: TObject); virtual;
|
||||
Function CanTab: Boolean; override;
|
||||
Procedure CMDrag(var Message : TCMDrag); message CM_DRAG;
|
||||
@ -2357,6 +2361,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.177 2004/02/21 15:37:33 mattias
|
||||
moved compiler options to project menu, added -CX for smartlinking
|
||||
|
||||
Revision 1.176 2004/02/17 00:32:25 mattias
|
||||
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||
|
||||
|
@ -1004,10 +1004,9 @@ Begin
|
||||
end; //case
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TControl.DragOver
|
||||
}
|
||||
{------------------------------------------------------------------------------}
|
||||
{------------------------------------------------------------------------------
|
||||
TControl.DragOver
|
||||
------------------------------------------------------------------------------}
|
||||
Procedure TControl.DragOver(Source: TObject; X,Y : Integer; State: TDragState;
|
||||
var Accept:Boolean);
|
||||
begin
|
||||
@ -1018,18 +1017,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TControl.DragDrop
|
||||
}
|
||||
{------------------------------------------------------------------------------}
|
||||
{------------------------------------------------------------------------------
|
||||
TControl.DragDrop
|
||||
------------------------------------------------------------------------------}
|
||||
Procedure TControl.DragDrop(Source: TObject; X,Y : Integer);
|
||||
begin
|
||||
If Assigned(FOnDragDrop) then FOnDragDrop(Self, Source,X,Y);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TControl Method SetColor "Sets the default color and tells the widget set" }
|
||||
{------------------------------------------------------------------------------}
|
||||
{------------------------------------------------------------------------------
|
||||
TControl Method SetColor "Sets the default color and tells the widget set"
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TControl.SetColor(value : TColor);
|
||||
begin
|
||||
if FColor <> Value then
|
||||
@ -1040,25 +1038,25 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TControl CanAutoSize }
|
||||
{------------------------------------------------------------------------------}
|
||||
{------------------------------------------------------------------------------
|
||||
TControl CanAutoSize
|
||||
------------------------------------------------------------------------------}
|
||||
Function TControl.CanAutoSize(Var NewWidth, NewHeight : Integer): Boolean;
|
||||
Begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TControl Dragging }
|
||||
{------------------------------------------------------------------------------}
|
||||
{------------------------------------------------------------------------------
|
||||
TControl Dragging
|
||||
------------------------------------------------------------------------------}
|
||||
Function TControl.Dragging: Boolean;
|
||||
Begin
|
||||
Result := (DragControl = self);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TControl GetBoundsRect }
|
||||
{------------------------------------------------------------------------------}
|
||||
{------------------------------------------------------------------------------
|
||||
TControl GetBoundsRect
|
||||
------------------------------------------------------------------------------}
|
||||
Function TControl.GetBoundsRect: TRect;
|
||||
Begin
|
||||
Result.Left := FLeft;
|
||||
@ -2771,6 +2769,9 @@ end;
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.170 2004/02/21 15:37:33 mattias
|
||||
moved compiler options to project menu, added -CX for smartlinking
|
||||
|
||||
Revision 1.169 2004/02/17 00:32:25 mattias
|
||||
fixed TCustomImage.DoAutoSize fixing uninitialized vars
|
||||
|
||||
|
@ -103,6 +103,7 @@ var
|
||||
SaveFont, StockFont: HFONT;
|
||||
TxtMetric: TTextMetric;}
|
||||
begin
|
||||
BeginUpdate;
|
||||
inherited CreateWnd;
|
||||
|
||||
{Perform(TB_SETEXTENDEDSTYLE, 0, LParam(Perform(TB_GETEXTENDEDSTYLE, 0, 0) or
|
||||
@ -124,6 +125,37 @@ begin
|
||||
end;
|
||||
RecreateButtons;
|
||||
Invalidate;}
|
||||
UpdateVisibleBar;
|
||||
EndUpdate;
|
||||
end;
|
||||
|
||||
procedure TToolBar.ControlsAligned;
|
||||
var
|
||||
i: Integer;
|
||||
CurControl: TControl;
|
||||
NewLeft: Integer;
|
||||
NewTop: Integer;
|
||||
NewWidth: Integer;
|
||||
NewHeight: Integer;
|
||||
begin
|
||||
if FUpdateCount>0 then begin
|
||||
UpdateVisibleBar;
|
||||
exit;
|
||||
end;
|
||||
writeln('TToolBar.ControlsAligned START');
|
||||
// ToDo
|
||||
// hack: stupid put in a row
|
||||
for i:=0 to ControlCount-1 do begin
|
||||
CurControl:=Controls[i];
|
||||
NewLeft:=i*ButtonWidth;
|
||||
NewTop:=0;
|
||||
NewWidth:=ButtonWidth;
|
||||
NewHeight:=ButtonHeight;
|
||||
writeln('TToolBar.ControlsAligned ',CurControl.Name,
|
||||
' Old=',CurControl.Left,',',CurControl.Top,',',CurControl.Width,',',CurControl.Height,
|
||||
' New=',NewLeft,',',NewTop,',',NewWidth,',',NewHeight);
|
||||
CurControl.SetBoundsKeepBase(NewLeft,NewTop,NewWidth,NewHeight,true);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TToolBar.RepositionButton(Index: Integer);
|
||||
@ -290,6 +322,7 @@ begin
|
||||
Include(FToolBarFlags,tbfUpdateVisibleBarNeeded);
|
||||
exit;
|
||||
end;
|
||||
writeln('TToolBar.UpdateVisibleBar');
|
||||
ReAlign;
|
||||
Invalidate;
|
||||
Exclude(FToolBarFlags,tbfUpdateVisibleBarNeeded);
|
||||
@ -340,14 +373,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TToolBar.AlignControls(AControl: TControl; var Rect: TRect);
|
||||
begin
|
||||
if FUpdateCount > 0 then Exit;
|
||||
BeginUpdate;
|
||||
// ToDo
|
||||
EndUpdate;
|
||||
end;
|
||||
|
||||
function TToolBar.CanAutoSize(var NewWidth, NewHeight: Integer): Boolean;
|
||||
begin
|
||||
Result := WrapButtons(NewWidth, NewHeight);
|
||||
@ -1906,6 +1931,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.19 2004/02/21 15:37:33 mattias
|
||||
moved compiler options to project menu, added -CX for smartlinking
|
||||
|
||||
Revision 1.18 2004/02/12 18:09:10 mattias
|
||||
removed win32 specific TToolBar code in new TToolBar, implemented TWinControl.FlipChildren
|
||||
|
||||
|
@ -111,6 +111,7 @@ var
|
||||
IconLeft: Integer;
|
||||
IconTop: Integer;
|
||||
begin
|
||||
writeln('TToolButton.Paint A FToolBar=',HexStr(Cardinal(FToolBar),8),' ',ClientWidth,',',ClientHeight);
|
||||
if FToolBar<>nil then begin
|
||||
PaintRect:=ClientRect; // the whole paint area
|
||||
|
||||
@ -118,7 +119,7 @@ begin
|
||||
ButtonRect:=PaintRect;
|
||||
if Style=tbsDropDown then begin
|
||||
DropDownButtonRect:=ButtonRect;
|
||||
DropDownButtonRect.Left:=Max(0,DropDownButtonRect.Right-10);
|
||||
DropDownButtonRect.Left:=Max(0,DropDownButtonRect.Right-10);// ToDo replace 10 by const
|
||||
ButtonRect.Right:=DropDownButtonRect.Left;
|
||||
end;
|
||||
|
||||
@ -168,23 +169,6 @@ begin
|
||||
inherited Paint;
|
||||
end;
|
||||
|
||||
function TToolButton.CalculateButtonState: Word;
|
||||
begin
|
||||
Result := 0;
|
||||
if FDown then
|
||||
if Style = tbsCheck then
|
||||
Result := Result or ButtonStates[tbsChecked]
|
||||
else
|
||||
Result := Result or ButtonStates[tbsPressed];
|
||||
if Enabled and ((FToolBar = nil) or FToolBar.Enabled) then
|
||||
Result := Result or ButtonStates[tbsEnabled];
|
||||
if not Visible and not (csDesigning in ComponentState) then
|
||||
Result := Result or ButtonStates[tbsHidden];
|
||||
if FIndeterminate then Result := Result or ButtonStates[tbsIndeterminate];
|
||||
if FWrap then Result := Result or ButtonStates[tbsWrap];
|
||||
if FMarked then Result := Result or ButtonStates[tbsMarked];
|
||||
end;
|
||||
|
||||
procedure TToolButton.SetAutoSize(const Value: Boolean);
|
||||
begin
|
||||
if Value = AutoSize then exit;
|
||||
@ -192,17 +176,6 @@ begin
|
||||
RequestAlign;
|
||||
end;
|
||||
|
||||
procedure TToolButton.SetButtonState(State: Word);
|
||||
begin
|
||||
FDown := State and (TBSTATE_CHECKED or TBSTATE_PRESSED) <> 0;
|
||||
Enabled := State and TBSTATE_ENABLED <> 0;
|
||||
if not (csDesigning in ComponentState) then
|
||||
Visible := State and TBSTATE_HIDDEN = 0;
|
||||
FIndeterminate := not FDown and (State and TBSTATE_INDETERMINATE <> 0);
|
||||
FWrap := State and TBSTATE_WRAP <> 0;
|
||||
FMarked := State and TBSTATE_MARKED <> 0;
|
||||
end;
|
||||
|
||||
procedure TToolButton.SetToolBar(NewToolBar: TToolBar);
|
||||
begin
|
||||
if FToolBar = NewToolBar then exit;
|
||||
@ -230,7 +203,10 @@ end;
|
||||
|
||||
procedure TToolButton.CMHitTest(var Message: TCMHitTest);
|
||||
begin
|
||||
Message.Result := Ord(not (Style in [tbsDivider, tbsSeparator]) or (DragKind = dkDock));
|
||||
if (not (Style in [tbsDivider, tbsSeparator])) or (DragKind = dkDock) then
|
||||
Message.Result := 1
|
||||
else
|
||||
Message.Result := 0;
|
||||
end;
|
||||
|
||||
procedure TToolButton.SetDown(Value: Boolean);
|
||||
@ -396,6 +372,7 @@ begin
|
||||
|
||||
// remove from old button list
|
||||
i:=Index;
|
||||
//writeln('TToolButton.SetParent A ',Name,' OldIndex=',Index);
|
||||
if i>=0 then
|
||||
FToolBar.FButtons.Delete(i);
|
||||
FToolBar:=nil;
|
||||
@ -409,17 +386,16 @@ begin
|
||||
i:=Index;
|
||||
if i<0 then
|
||||
FToolBar.FButtons.Add(Self);
|
||||
UpdateVisibleToolbar;
|
||||
end;
|
||||
//writeln('TToolButton.SetParent A ',Name,' NewIndex=',Index);
|
||||
end;
|
||||
|
||||
procedure TToolButton.UpdateVisibleToolbar;
|
||||
var
|
||||
AToolBar: TToolBar;
|
||||
begin
|
||||
if Parent is TToolBar then begin
|
||||
AToolBar:=TToolBar(Parent);
|
||||
AToolBar.UpdateVisibleBar;
|
||||
end;
|
||||
//writeln('TToolButton.UpdateVisibleToolbar ',Parent is TToolBar);
|
||||
if Parent is TToolBar then
|
||||
TToolBar(Parent).UpdateVisibleBar;
|
||||
end;
|
||||
|
||||
{$ELSE NewToolBar}
|
||||
@ -888,6 +864,9 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.9 2004/02/21 15:37:33 mattias
|
||||
moved compiler options to project menu, added -CX for smartlinking
|
||||
|
||||
Revision 1.8 2004/02/13 15:49:54 mattias
|
||||
started advanced LCL auto sizing
|
||||
|
||||
|
@ -258,7 +258,7 @@ var
|
||||
if NewWidth<0 then NewWidth:=0;
|
||||
if NewHeight<0 then NewHeight:=0;
|
||||
|
||||
if AAlign<>alNone then begin
|
||||
if AAlign in [alLeft,alTop,alRight,alBottom,alClient] then begin
|
||||
{ Realign
|
||||
|
||||
Use Align to align a control to the top, bottom, left, or right of a
|
||||
@ -468,8 +468,10 @@ var
|
||||
AlignList.Insert(X, Control);
|
||||
end;
|
||||
end;
|
||||
for I := 0 to AlignList.Count - 1 do
|
||||
DoPosition(TControl(AlignList[I]), AAlign);
|
||||
|
||||
if not DoAlignChildControls(AAlign,AControl,AlignList,ARect) then
|
||||
for I := 0 to AlignList.Count - 1 do
|
||||
DoPosition(TControl(AlignList[I]), AAlign);
|
||||
end;
|
||||
|
||||
var
|
||||
@ -487,10 +489,10 @@ begin
|
||||
end;
|
||||
|
||||
try
|
||||
{if csDesigning in ComponentState then begin
|
||||
writeln('[TWinControl.AlignControls] ',Name,':',Classname,' ',Left,',',Top,',',Width,',',Height,' AlignWork=',AlignWork);
|
||||
if AControl<>nil then writeln(' AControl=',AControl.Name,':',AControl.ClassName);
|
||||
end;}
|
||||
//if csDesigning in ComponentState then begin
|
||||
//writeln('[TWinControl.AlignControls] ',Name,':',Classname,' ',Left,',',Top,',',Width,',',Height,' AlignWork=',AlignWork);
|
||||
//if AControl<>nil then writeln(' AControl=',AControl.Name,':',AControl.ClassName);
|
||||
//end;
|
||||
if AlignWork then
|
||||
begin
|
||||
AdjustClientRect(ARect);
|
||||
@ -507,11 +509,11 @@ begin
|
||||
DoAlign(alClient);
|
||||
DoAlign(alCustom);
|
||||
DoAlign(alNone);
|
||||
ControlsAligned;
|
||||
finally
|
||||
AlignList.Free;
|
||||
end;
|
||||
end;
|
||||
ControlsAligned;
|
||||
finally
|
||||
Exclude(FFlags,wcfAligningControls);
|
||||
end;
|
||||
@ -519,6 +521,12 @@ begin
|
||||
if Showing then AdjustSize;
|
||||
end;
|
||||
|
||||
function TWinControl.DoAlignChildControls(TheAlign: TAlign; AControl: TControl;
|
||||
AControlList: TList; var ARect: TRect): Boolean;
|
||||
begin
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
procedure TWinControl.DoChildSizingChange(Sender: TObject);
|
||||
begin
|
||||
AdjustSize;
|
||||
@ -3370,6 +3378,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.202 2004/02/21 15:37:33 mattias
|
||||
moved compiler options to project menu, added -CX for smartlinking
|
||||
|
||||
Revision 1.201 2004/02/13 15:49:54 mattias
|
||||
started advanced LCL auto sizing
|
||||
|
||||
|
@ -145,6 +145,7 @@ type
|
||||
function CreateStatusBarPanel(StatusBar: TObject; Index: integer): PGtkWidget;
|
||||
function CreateSimpleClientAreaWidget(Sender: TObject;
|
||||
NotOnParentsClientArea: boolean): PGtkWidget;
|
||||
function CreateToolBar(ToolBarObject: TObject): PGtkWidget;
|
||||
procedure CreateComponent(Sender : TObject);virtual;
|
||||
procedure DestroyEmptySubmenu(Sender: TObject);virtual;
|
||||
procedure DestroyLCLComponent(Sender: TObject);virtual;
|
||||
@ -422,6 +423,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.168 2004/02/21 15:37:33 mattias
|
||||
moved compiler options to project menu, added -CX for smartlinking
|
||||
|
||||
Revision 1.167 2004/01/22 11:23:36 mattias
|
||||
started MaskBlt for gtkIF and applied patch for dir dlg in env opts from Vincent
|
||||
|
||||
|
@ -1079,6 +1079,9 @@ procedure TgtkObject.RealizeWidgetSize(Widget: PGtkWidget; NewWidth,
|
||||
NewHeight: integer);
|
||||
var
|
||||
Requisition: TGtkRequisition;
|
||||
{$IFDEF NewToolBar}
|
||||
FixedWidget: Pointer;
|
||||
{$ENDIF}
|
||||
{$IFDEF VerboseSizeMsg}
|
||||
LCLObject: TObject;
|
||||
{$ENDIF}
|
||||
@ -1120,6 +1123,16 @@ begin
|
||||
gtk_widget_set_usize(PGtkCombo(Widget)^.entry,
|
||||
PGtkCombo(Widget)^.entry^.allocation.width, NewHeight);
|
||||
end;
|
||||
|
||||
{$IFDEF NewToolBar}
|
||||
if GtkWidgetIsA(Widget,gtk_toolbar_get_type) then begin
|
||||
FixedWidget:=GetFixedWidget(Widget);
|
||||
if (FixedWidget<>nil) and (FixedWidget<>Widget) then begin
|
||||
writeln('WARNING: ToDo TgtkObject.RealizeWidgetSize ',NewWidth,',',NewHeight);
|
||||
gtk_widget_set_usize(FixedWidget,NewWidth,NewHeight);
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -2921,9 +2934,7 @@ begin
|
||||
Widget := PgtkWidget(TCustomForm(Sender).Handle);
|
||||
AWindow:=GetControlWindow(Widget);
|
||||
if AWindow<>nil then begin
|
||||
BeginGDKErrorTrap;
|
||||
gdk_window_raise(AWindow);
|
||||
EndGDKErrorTrap;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2952,9 +2963,7 @@ var
|
||||
pixmapwid : pGtkWidget; // currently only used for TBitBtn, possibly replace with pixmap!!!!
|
||||
pLabel : PgtkWidget; // currently only used as extra label-widget for TBitBtn
|
||||
Num : Integer; // currently only used for LM_INSERTTOOLBUTTON and LM_ADDITEM
|
||||
{$IFNDEF NewToolBar}
|
||||
pStr2 : PChar; // currently only used for LM_INSERTTOOLBUTTON
|
||||
{$ENDIF}
|
||||
GList : pGList; // Only used for listboxes, replace with widget!!!!!
|
||||
ListItem : PGtkListItem; // currently only used for listboxes
|
||||
Rect : TRect;
|
||||
@ -3028,21 +3037,19 @@ begin
|
||||
LM_AddChild :
|
||||
begin
|
||||
Assert(False, 'Trace:Adding a child to Parent');
|
||||
If (TWinControl(Sender).Parent is TToolbar) then
|
||||
Begin
|
||||
// Assert(False, Format('Trace: [TgtkObject.IntSendMessage3] %s --> %s ---calling INSERTBUTTON from Add Child', [AParent.ClassName, Sender.ClassNAme]));
|
||||
{$IFNDEF NewToolBar}
|
||||
If (TControl(Sender).Parent is TToolbar) then Begin
|
||||
exit;
|
||||
end;
|
||||
{$ENDIF}
|
||||
AParent := (Sender as TWinControl).Parent;
|
||||
if Not Assigned(AParent) then Begin
|
||||
Assert(true, Format('Trace: [TgtkObject.IntSendMessage3] %s --> Parent is not assigned', [Sender.ClassName]));
|
||||
end
|
||||
else Begin
|
||||
AParent := (Sender as TWinControl).Parent;
|
||||
if Not Assigned(AParent) then Begin
|
||||
Assert(true, Format('Trace: [TgtkObject.IntSendMessage3] %s --> Parent is not assigned', [Sender.ClassName]));
|
||||
end
|
||||
else Begin
|
||||
Assert(False, Format('Trace: [TgtkObject.IntSendMessage3] %s --> Calling Add Child: %s', [AParent.ClassName, Sender.ClassNAme]));
|
||||
AddChild(Pgtkwidget(AParent.Handle), PgtkWidget(Handle),
|
||||
AParent.Left, AParent.Top);
|
||||
end;
|
||||
Assert(False, Format('Trace: [TgtkObject.IntSendMessage3] %s --> Calling Add Child: %s', [AParent.ClassName, Sender.ClassNAme]));
|
||||
AddChild(Pgtkwidget(AParent.Handle), PgtkWidget(Handle),
|
||||
AParent.Left, AParent.Top);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -3331,6 +3338,10 @@ begin
|
||||
|
||||
LM_TB_BUTTONCOUNT:
|
||||
begin
|
||||
{$IFDEF NewToolBar}
|
||||
writeln('Obsolete: TgtkObject.IntSendMessage3 LM_TB_BUTTONCOUNT');
|
||||
exit;
|
||||
{$ENDIF}
|
||||
if (Sender is TToolbar)
|
||||
then Result := pgtkToolbar(Handle)^.num_Children
|
||||
else Result := -1;
|
||||
@ -3388,9 +3399,10 @@ begin
|
||||
LM_INSERTTOOLBUTTON:
|
||||
begin
|
||||
{$IFDEF NewToolBar}
|
||||
writeln('tgtkobject.IntSendMessage3 LM_INSERTTOOLBUTTON');
|
||||
{$ELSE}
|
||||
If (SENDER is TWINCONTROL) Then
|
||||
writeln('Obsolete: TgtkObject.IntSendMessage3 LM_INSERTTOOLBUTTON');
|
||||
exit;
|
||||
{$ENDIF}
|
||||
If (SENDER is TToolbutton) Then
|
||||
Begin
|
||||
pStr := StrAlloc(Length(TToolbutton(SENDER).Caption)+1);
|
||||
try
|
||||
@ -3413,21 +3425,20 @@ begin
|
||||
pgtkwidget(handle),pstr,pStr2,Num);
|
||||
StrDispose(pStr);
|
||||
StrDispose(pStr2);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
LM_DELETETOOLBUTTON:
|
||||
Begin
|
||||
{$IFDEF NewToolBar}
|
||||
writeln('tgtkobject.IntSendMessage3 LM_DELETETOOLBUTTON');
|
||||
{$ELSE}
|
||||
writeln('Obsolete: TgtkObject.IntSendMessage3 LM_DELETETOOLBUTTON');
|
||||
exit;
|
||||
{$ENDIF}
|
||||
with pgtkToolbar(TToolbar(TWinControl(Sender).parent).handle)^ do
|
||||
children := g_list_remove(pgList(children), sender);
|
||||
// Next 3 lines: should be same as above, remove when above lines are proofed
|
||||
// pgtkToolbar(TToolbar(TWinControl(Sender).parent).handle)^.children :=
|
||||
// g_list_remove(pgList(pgtkToolbar(TToolbar(TWinControl(Sender).parent).handle)^.children),
|
||||
// sender);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
LM_Invalidate :
|
||||
@ -6228,6 +6239,33 @@ begin
|
||||
gtk_widget_show(Result);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function TgtkObject.CreateToolBar(ToolBarObject: TObject): PGtkWidget;
|
||||
|
||||
Creates a gtk_toolbar and puts a fixed widget as client area.
|
||||
Since we are not using the gtk tool buttons, we can put any LCL control as
|
||||
child and get all LCL TControl abilities.
|
||||
------------------------------------------------------------------------------}
|
||||
function TgtkObject.CreateToolBar(ToolBarObject: TObject): PGtkWidget;
|
||||
{$IFDEF NewToolBar}
|
||||
var
|
||||
ClientWidget: PGtkWidget;
|
||||
{$ENDIF}
|
||||
begin
|
||||
Result := gtk_toolbar_new();
|
||||
{$IFDEF NewToolBar}
|
||||
ClientWidget := gtk_fixed_new();
|
||||
gtk_toolbar_insert_widget(PGTKToolbar(Result),ClientWidget,nil,nil,0);
|
||||
gtk_widget_show(ClientWidget);
|
||||
SetFixedWidget(Result,ClientWidget);
|
||||
SetMainWidget(Result,ClientWidget);
|
||||
gtk_toolbar_set_space_size(PGTKToolbar(Result),0);
|
||||
gtk_toolbar_set_space_style(PGTKToolbar(Result),GTK_TOOLBAR_SPACE_EMPTY);
|
||||
writeln('TgtkObject.CreateToolBar ',PGTKToolbar(Result)^.button_maxw,',',PGTKToolbar(Result)^.button_maxh);
|
||||
{$ENDIF}
|
||||
gtk_widget_show(Result);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: TGTKObject.CreateComponent
|
||||
Params: sender - object for which to create visual representation
|
||||
@ -6673,14 +6711,11 @@ begin
|
||||
|
||||
csToggleBox :
|
||||
begin
|
||||
P := gtk_toggle_button_new_with_label(StrTemp);
|
||||
P := gtk_toggle_button_new_with_label(StrTemp);
|
||||
end;
|
||||
|
||||
csToolbar:
|
||||
begin
|
||||
p := gtk_toolbar_new();
|
||||
gtk_widget_show (P);
|
||||
end;
|
||||
P:=CreateToolBar(Sender);
|
||||
|
||||
csToolButton:
|
||||
begin
|
||||
@ -9190,6 +9225,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.470 2004/02/21 15:37:33 mattias
|
||||
moved compiler options to project menu, added -CX for smartlinking
|
||||
|
||||
Revision 1.469 2004/02/21 01:01:03 mattias
|
||||
added uninstall popupmenuitem to package graph explorer
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user