mirror of https://gitlab.com/basile.b/dexed.git
added about box
This commit is contained in:
parent
8c7f6cc270
commit
144b365596
|
@ -135,7 +135,7 @@
|
|||
<PackageName Value="LCL"/>
|
||||
</Item6>
|
||||
</RequiredPackages>
|
||||
<Units Count="38">
|
||||
<Units Count="39">
|
||||
<Unit0>
|
||||
<Filename Value="coedit.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
|
@ -334,6 +334,13 @@
|
|||
<Filename Value="..\src\ce_processes.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit37>
|
||||
<Unit38>
|
||||
<Filename Value="..\src\ce_infos.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="CEInfoWidget"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit38>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
|
|
@ -6,10 +6,10 @@ uses
|
|||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols,
|
||||
ce_sharedres, ce_observer, ce_libman, ce_tools, ce_dcd, ce_main,
|
||||
ce_writableComponent, ce_symstring, ce_staticmacro, ce_inspectors,
|
||||
ce_editoroptions, ce_dockoptions, ce_shortcutseditor, ce_mru, ce_processes;
|
||||
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_sharedres,
|
||||
ce_observer, ce_libman, ce_tools, ce_dcd, ce_main, ce_writableComponent,
|
||||
ce_symstring, ce_staticmacro, ce_inspectors, ce_editoroptions, ce_dockoptions,
|
||||
ce_shortcutseditor, ce_mru, ce_processes;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
inherited CEInfoWidget: TCEInfoWidget
|
||||
Left = 714
|
||||
Height = 282
|
||||
Top = 271
|
||||
Width = 337
|
||||
BorderIcons = [biSystemMenu, biMinimize, biMaximize]
|
||||
Caption = 'About'
|
||||
ClientHeight = 282
|
||||
ClientWidth = 337
|
||||
inherited Back: TPanel
|
||||
Height = 282
|
||||
Width = 337
|
||||
ClientHeight = 282
|
||||
ClientWidth = 337
|
||||
inherited Content: TPanel
|
||||
Height = 282
|
||||
Width = 337
|
||||
ClientHeight = 282
|
||||
ClientWidth = 337
|
||||
object GroupBox1: TGroupBox[0]
|
||||
Left = 4
|
||||
Height = 105
|
||||
Top = 4
|
||||
Width = 329
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 4
|
||||
Caption = 'about'
|
||||
ClientHeight = 85
|
||||
ClientWidth = 325
|
||||
TabOrder = 0
|
||||
object Label1: TLabel
|
||||
Left = 0
|
||||
Height = 85
|
||||
Top = 0
|
||||
Width = 325
|
||||
Align = alClient
|
||||
Alignment = taCenter
|
||||
AutoSize = False
|
||||
Caption = 'Coedit 1 - update 2'
|
||||
Font.Height = -16
|
||||
Font.Style = [fsBold]
|
||||
Layout = tlCenter
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
end
|
||||
object GroupBox2: TGroupBox[1]
|
||||
Left = 4
|
||||
Height = 165
|
||||
Top = 113
|
||||
Width = 329
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 4
|
||||
Caption = 'tools status'
|
||||
ClientHeight = 145
|
||||
ClientWidth = 325
|
||||
TabOrder = 1
|
||||
object boxTools: TScrollBox
|
||||
Left = 4
|
||||
Height = 137
|
||||
Top = 4
|
||||
Width = 317
|
||||
HorzScrollBar.Page = 1
|
||||
VertScrollBar.Page = 1
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 4
|
||||
BorderStyle = bsNone
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,179 @@
|
|||
unit ce_infos;
|
||||
|
||||
{$I ce_defines.inc}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||
StdCtrls, ExtCtrls, Buttons, Menus,ce_widget, ce_common;
|
||||
|
||||
type
|
||||
|
||||
TToolInfoKind = (tikRunning, tikFindable);
|
||||
|
||||
TToolInfo = class(TWinControl)
|
||||
private
|
||||
fLabel: TLabel;
|
||||
fStatus: TStaticText;
|
||||
fKind: TToolInfoKind;
|
||||
fToolName: string;
|
||||
fIco: TSpeedButton;
|
||||
procedure buttonClick(sender: TObject);
|
||||
protected
|
||||
procedure SetVisible(Value: Boolean); override;
|
||||
public
|
||||
constructor Construct(TheOwner: TComponent; kind: TToolInfoKind;const toolName: string);
|
||||
procedure refreshStatus;
|
||||
procedure Update; override;
|
||||
end;
|
||||
|
||||
|
||||
{ TCEInfoWidget }
|
||||
|
||||
TCEInfoWidget = class(TCEWidget)
|
||||
boxTools: TScrollBox;
|
||||
GroupBox1: TGroupBox;
|
||||
GroupBox2: TGroupBox;
|
||||
Label1: TLabel;
|
||||
private
|
||||
public
|
||||
constructor create(aOwner: TComponent); override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
constructor TToolInfo.Construct(TheOwner: TComponent; kind: TToolInfoKind;const toolName: string);
|
||||
begin
|
||||
Inherited create(TheOwner);
|
||||
Align := alTop;
|
||||
height := 26;
|
||||
width := 200;
|
||||
//
|
||||
fLabel := TLabel.Create(self);
|
||||
fLabel.AutoSize:=false;
|
||||
fLabel.Parent := self;
|
||||
fLabel.Align:= alLeft;
|
||||
fLabel.Width:= 60;
|
||||
fLabel.BorderSpacing.Around := 2;
|
||||
//
|
||||
fIco := TSpeedButton.Create(self);
|
||||
fIco.Parent := self;
|
||||
fIco.Align:= alLeft;
|
||||
fIco.Width:= 22;
|
||||
fIco.Flat:=true;
|
||||
fIco.BorderSpacing.Around := 2;
|
||||
fIco.OnClick:= @buttonClick;
|
||||
fIco.Hint:= 'refresh the status';
|
||||
fIco.ShowHint:= true;
|
||||
//
|
||||
fStatus := TStaticText.Create(self);
|
||||
fStatus.Parent:=self;
|
||||
fStatus.Align:= alClient;
|
||||
fStatus.BorderSpacing.Around := 2;
|
||||
fStatus.BorderStyle := sbsSunken;
|
||||
fStatus.AutoSize:=false;
|
||||
//
|
||||
fKind:=kind;
|
||||
fToolName:=toolName;
|
||||
refreshStatus;
|
||||
end;
|
||||
|
||||
procedure TToolInfo.SetVisible(Value: Boolean);
|
||||
begin
|
||||
inherited;
|
||||
refreshStatus;
|
||||
end;
|
||||
|
||||
procedure TToolInfo.Update;
|
||||
begin
|
||||
inherited;
|
||||
refreshStatus;
|
||||
end;
|
||||
|
||||
procedure TToolInfo.buttonClick(sender: TObject);
|
||||
begin
|
||||
refreshStatus;
|
||||
end;
|
||||
|
||||
procedure TToolInfo.refreshStatus;
|
||||
var
|
||||
pth: string;
|
||||
png: TPortableNetworkGraphic;
|
||||
begin
|
||||
if (fLabel = nil) or (fStatus = nil) then exit;
|
||||
//
|
||||
fLabel.Caption:= fToolName;
|
||||
png := TPortableNetworkGraphic.Create;
|
||||
try case fKind of
|
||||
tikFindable:
|
||||
begin
|
||||
pth := exeFullName(fToolName + exeExt);
|
||||
if pth = '' then
|
||||
begin
|
||||
fStatus.Caption:= 'the tool cannot be found';
|
||||
png.LoadFromLazarusResource('bullet_red');
|
||||
end
|
||||
else
|
||||
begin
|
||||
fStatus.Caption:= 'the tool is available';
|
||||
png.LoadFromLazarusResource('bullet_green');
|
||||
end;
|
||||
end;
|
||||
tikRunning:
|
||||
begin
|
||||
pth := exeFullName(fToolName + exeExt);
|
||||
if pth = '' then
|
||||
begin
|
||||
fStatus.Caption:= 'the tool cannot be found';
|
||||
png.LoadFromLazarusResource('bullet_red');
|
||||
end
|
||||
else if AppIsRunning(fToolName + exeExt) then
|
||||
begin
|
||||
fStatus.Caption:= 'the tool is available and running';
|
||||
png.LoadFromLazarusResource('bullet_green');
|
||||
end
|
||||
else
|
||||
begin
|
||||
fStatus.Caption:= 'the tool is available but is not running';
|
||||
png.LoadFromLazarusResource('bullet_yellow');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
fIco.Glyph.Assign(png);
|
||||
png.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TCEInfoWidget.create(aOwner: TComponent);
|
||||
var
|
||||
toolItem: TToolInfo;
|
||||
begin
|
||||
inherited;
|
||||
fModal := true;
|
||||
fDockable := false;
|
||||
//
|
||||
toolItem := TToolInfo.Construct(self, tikRunning, 'dcd-server');
|
||||
toolItem.Parent := boxTools;
|
||||
toolItem.ReAlign;
|
||||
toolItem := TToolInfo.Construct(self, tikFindable, 'dcd-client');
|
||||
toolItem.Parent := boxTools;
|
||||
toolItem.ReAlign;
|
||||
toolItem := TToolInfo.Construct(self, tikFindable, 'cesyms');
|
||||
toolItem.Parent := boxTools;
|
||||
toolItem.ReAlign;
|
||||
toolItem := TToolInfo.Construct(self, tikFindable, 'cetodo');
|
||||
toolItem.Parent := boxTools;
|
||||
toolItem.ReAlign;
|
||||
toolItem := TToolInfo.Construct(self, tikFindable, 'dmd');
|
||||
toolItem.Parent := boxTools;
|
||||
toolItem.ReAlign;
|
||||
//
|
||||
Realign;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
@ -11,7 +11,8 @@ uses
|
|||
ce_common, ce_dmdwrap, ce_nativeproject, ce_dcd, ce_synmemo, ce_writableComponent,
|
||||
ce_widget, ce_messages, ce_interfaces, ce_editor, ce_projinspect, ce_projconf,
|
||||
ce_search, ce_miniexplorer, ce_libman, ce_libmaneditor, ce_todolist, ce_observer,
|
||||
ce_toolseditor, ce_procinput, ce_optionseditor, ce_symlist, ce_mru, ce_processes;
|
||||
ce_toolseditor, ce_procinput, ce_optionseditor, ce_symlist, ce_mru, ce_processes,
|
||||
ce_infos;
|
||||
|
||||
type
|
||||
|
||||
|
@ -205,6 +206,7 @@ type
|
|||
fTodolWidg: TCETodoListWidget;
|
||||
fOptEdWidg: TCEOptionEditorWidget;
|
||||
fSymlWidg: TCESymbolListWidget;
|
||||
fInfoWidg: TCEInfoWidget;
|
||||
|
||||
fInitialized: boolean;
|
||||
fRunnableSw: string;
|
||||
|
@ -509,6 +511,7 @@ begin
|
|||
fTodolWidg:= TCETodoListWidget.create(self);
|
||||
fOptEdWidg:= TCEOptionEditorWidget.create(self);
|
||||
fSymlWidg := TCESymbolListWidget.create(self);
|
||||
fInfoWidg := TCEInfoWidget.create(self);
|
||||
|
||||
getMessageDisplay(fMsgs);
|
||||
|
||||
|
@ -524,6 +527,7 @@ begin
|
|||
fWidgList.addWidget(@fTodolWidg);
|
||||
fWidgList.addWidget(@fOptEdWidg);
|
||||
fWidgList.addWidget(@fSymlWidg);
|
||||
fWidgList.addWidget(@fInfoWidg);
|
||||
fWidgList.sort(@CompareWidgCaption);
|
||||
|
||||
for widg in fWidgList do
|
||||
|
|
Loading…
Reference in New Issue