new component for display service status

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1302 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2010-08-25 17:45:41 +00:00
parent 5145fc762a
commit 3e52125f09
8 changed files with 251 additions and 29 deletions

View File

@@ -163,6 +163,7 @@
<link id="TRxDBGrid">RxDBGrid</link>-а.</p> <link id="TRxDBGrid">RxDBGrid</link>-а.</p>
</descr> </descr>
</element> </element>
@@ -566,6 +567,7 @@
<link id="TRxDBGrid">RxDBGrid</link>-а.</p> <link id="TRxDBGrid">RxDBGrid</link>-а.</p>
</descr> </descr>
<seealso> <seealso>
@@ -1151,6 +1153,7 @@ TRxDBCalcEdit является наследником TDBCalcEdit и имеет
<b>Count</b> <b>Count</b>
@@ -2428,6 +2431,7 @@ Description
<b>const</b> SearchDomain, FileName: <b>const</b> SearchDomain, FileName:
@@ -2450,6 +2454,7 @@ Description
<b>String</b>; <b>String</b>;
@@ -2472,6 +2477,7 @@ Description
<b>out</b> UserName, DomainName: <b>out</b> UserName, DomainName:
@@ -2494,6 +2500,7 @@ Description
<b>String</b>); <b>String</b>);
@@ -2535,6 +2542,7 @@ Description
<b>const</b> DirName: <b>const</b> DirName:
@@ -2551,6 +2559,7 @@ Description
<b>string</b>): <b>string</b>):
@@ -2567,6 +2576,7 @@ Description
<b>string</b>;</p> <b>string</b>;</p>
<p>Функция проверяет все разделители каталогов в указанном имени файла/каталога и, если нужно, меняет их на значение константы<b>DirectorySeparator</b>.</p> <p>Функция проверяет все разделители каталогов в указанном имени файла/каталога и, если нужно, меняет их на значение константы<b>DirectorySeparator</b>.</p>
</descr> </descr>
@@ -2596,6 +2606,7 @@ Description
<b>string</b>;</p> <b>string</b>;</p>
<p>Функция <b>GetUserName</b> возвращает имя оператора, залогиненго в системе</p> <p>Функция <b>GetUserName</b> возвращает имя оператора, залогиненго в системе</p>
@@ -2842,5 +2853,34 @@ Description
<example file="/usr/local/share/lazarus/components/rxnew/Demos/RxViewsPanel/unit1.pas"/> <example file="/usr/local/share/lazarus/components/rxnew/Demos/RxViewsPanel/unit1.pas"/>
</element> </element>
</module> </module>
<module name="RxSystemServices">
<element name="TRxServiceType"/>
<element name="TRxServiceStatus"/>
<element name="TRxServiceState"/>
<element name="TRxServiceItem"/>
<element name="TRxSystemServices">
<short>Компонента получает состояние служб на указанном компьютере</short>
</element>
<element name="TRxSystemServices.Create"/>
<element name="TRxSystemServices.Destroy"/>
<element name="TRxSystemServices.Items">
<short>Массив содержит список служб, работающих в системе</short>
</element>
<element name="TRxSystemServices.ItemCount">
<short>Количество эелементов в массиве Items</short>
</element>
<element name="TRxSystemServices.ServerName">
<short>Имя компьютера, на котором опрашиваются службы</short>
</element>
<element name="TRxSystemServices.ServiceType">
<short>Фильтр отбора служб по типу (служба/драйвер)</short>
</element>
<element name="TRxSystemServices.ServiceStatus">
<short>Фильтр отбора служб по статусу работает/остановлена</short>
</element>
<short>Модуль содержит компоненту TRxSystemServices</short>
<descr>Модуль RxSystemServices предназначен для получения информации о состоянии работающих в системе служб (windows) / демонов (unix-like)
Cодержит компоненту <link id="TRxSystemServices">TRxSystemServices</link>.</descr>
</module>
</package> </package>
</fpdoc-descriptions> </fpdoc-descriptions>

View File

@@ -42,11 +42,11 @@ procedure Register;
implementation implementation
uses uses
PropEdits, dbdateedit, dbcurredit, rxlookup, folderlister, rxmemds, duallist, PropEdits, dbdateedit, dbcurredit, rxlookup, folderlister, duallist,
curredit, rxswitch, rxdice, rxdbcomb, rxtoolbar, rxxpman, PageMngr, RxAppIcon, curredit, rxswitch, rxdice, rxdbcomb, rxtoolbar, rxxpman, PageMngr, RxAppIcon,
Dialogs, ComponentEditors, seldsfrm, DBPropEdits, DB, rxctrls, RxLogin, Dialogs, ComponentEditors, DBPropEdits, DB, rxctrls,
RxCustomChartPanel, AutoPanel, pickdate, rxconst, tooledit, rxclock, RxCustomChartPanel, AutoPanel, pickdate, rxconst, tooledit, rxclock,
rxceEditLookupFields, rxpopupunit, rxspin, RxTimeEdit, RxVersInfo, rxceEditLookupFields, rxpopupunit, rxspin, RxTimeEdit,
RxAboutDialog, RxViewsPanel; RxAboutDialog, RxViewsPanel;
type type
@@ -102,11 +102,6 @@ begin
RegisterComponents('RX DBAware',[TRXLookupEdit, TRxDBLookupCombo]); RegisterComponents('RX DBAware',[TRXLookupEdit, TRxDBLookupCombo]);
end; end;
procedure RegisterRxMemDS;
begin
RegisterComponents('RX DBAware',[TRxMemoryData]);
end;
procedure RegisterRxDBComb; procedure RegisterRxDBComb;
begin begin
RegisterComponents('RX DBAware',[TRxDBComboBox]); RegisterComponents('RX DBAware',[TRxDBComboBox]);
@@ -183,16 +178,6 @@ begin
RegisterComponents('RX',[TRxTimeEdit]); RegisterComponents('RX',[TRxTimeEdit]);
end; end;
procedure RegisterRxLogin;
begin
RegisterComponents('RX',[TRxLoginDialog]);
end;
procedure RegisterRxVersInfo;
begin
RegisterComponents('RX',[TRxVersionInfo]);
end;
procedure RegisterRxAboutDialog; procedure RegisterRxAboutDialog;
begin begin
RegisterComponents('RX',[TRxAboutDialog]); RegisterComponents('RX',[TRxAboutDialog]);
@@ -227,19 +212,14 @@ begin
RegisterUnit('rxclock', @RegisterRxClock); RegisterUnit('rxclock', @RegisterRxClock);
RegisterUnit('rxspin', @RegisterRxSpin); RegisterUnit('rxspin', @RegisterRxSpin);
RegisterUnit('RxTimeEdit', @RegisterRxTimeEdit); RegisterUnit('RxTimeEdit', @RegisterRxTimeEdit);
RegisterUnit('RxLogin', @RegisterRxLogin);
RegisterUnit('RxVersInfo', @RegisterRxVersInfo);
RegisterUnit('RxAboutDialog', @RegisterRxAboutDialog); RegisterUnit('RxAboutDialog', @RegisterRxAboutDialog);
RegisterUnit('RxViewsPanel', @RegisterRxViewsPanel); RegisterUnit('RxViewsPanel', @RegisterRxViewsPanel);
//RX DBAware //RX DBAware
RegisterUnit('dbdateedit', @RegisterUnitDBDateEdit); RegisterUnit('dbdateedit', @RegisterUnitDBDateEdit);
RegisterUnit('rxlookup', @RegisterRXLookup); RegisterUnit('rxlookup', @RegisterRXLookup);
RegisterUnit('rxmemds', @RegisterRxMemDS);
RegisterUnit('rxdbcomb', @RegisterRxDBComb); RegisterUnit('rxdbcomb', @RegisterRxDBComb);
//Component Editors
RegisterComponentEditor(TRxMemoryData, TMemDataSetEditor);
// //
RegisterPropertyEditor(TypeInfo(string), TPopUpColumn, 'FieldName', TPopUpColumnFieldProperty); RegisterPropertyEditor(TypeInfo(string), TPopUpColumn, 'FieldName', TPopUpColumnFieldProperty);

View File

@@ -40,7 +40,8 @@ uses
procedure Register; procedure Register;
implementation implementation
uses DB, DBPropEdits, rxdbgrid, RxDBSpinEdit, RxDBTimeEdit, RxDBCtrls, PropEdits; uses DB, DBPropEdits, rxdbgrid, RxDBSpinEdit, RxDBTimeEdit, RxDBCtrls, rxmemds,
ComponentEditors, seldsfrm, PropEdits;
type type
@@ -111,13 +112,23 @@ begin
RegisterComponents('RX DBAware',[TRxDBGrid]); RegisterComponents('RX DBAware',[TRxDBGrid]);
end; end;
procedure RegisterRxMemDS;
begin
RegisterComponents('RX DBAware',[TRxMemoryData]);
end;
procedure Register; procedure Register;
begin begin
RegisterUnit('RxDBTimeEdit', @RegisterRxDBTimeEdit); RegisterUnit('RxDBTimeEdit', @RegisterRxDBTimeEdit);
RegisterUnit('RxDBSpinEdit', @RegisterRxDBSpinEdit); RegisterUnit('RxDBSpinEdit', @RegisterRxDBSpinEdit);
RegisterUnit('RxDBCtrls', @RegisterRxDBCtrls); RegisterUnit('RxDBCtrls', @RegisterRxDBCtrls);
RegisterUnit('rxdbgrid', @RegisterRxDbGrid); RegisterUnit('rxdbgrid', @RegisterRxDbGrid);
// RegisterUnit('rxmemds', @RegisterRxMemDS);
//Component Editors
RegisterComponentEditor(TRxMemoryData, TMemDataSetEditor);
//
RegisterPropertyEditor(TypeInfo(string), TRxColumn, 'FieldName', TRxDBGridFieldProperty); RegisterPropertyEditor(TypeInfo(string), TRxColumn, 'FieldName', TRxDBGridFieldProperty);
RegisterPropertyEditor(TypeInfo(string), TRxColumnFooter, 'FieldName', TRxDBGridFooterFieldProperty); RegisterPropertyEditor(TypeInfo(string), TRxColumnFooter, 'FieldName', TRxDBGridFooterFieldProperty);
end; end;

View File

@@ -0,0 +1,40 @@
unit RegisterRxTools;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, LazarusPackageIntf;
procedure Register;
implementation
uses RxSystemServices, RxLogin, RxVersInfo;
const
sRxToolsPage = 'RX Tools';
procedure RegisterRxSystemServices;
begin
RegisterComponents(sRxToolsPage, [TRxSystemServices]);
end;
procedure RegisterRxLogin;
begin
RegisterComponents(sRxToolsPage, [TRxLoginDialog]);
end;
procedure RegisterRxVersInfo;
begin
RegisterComponents(sRxToolsPage, [TRxVersionInfo]);
end;
procedure Register;
begin
RegisterUnit('RxLogin', @RegisterRxLogin);
RegisterUnit('RxVersInfo', @RegisterRxVersInfo);
RegisterUnit('RxSystemServices', @RegisterRxSystemServices);
end;
end.

View File

@@ -27,7 +27,7 @@ translate to Lazarus by alexs in 2005 - 2009
<License Value="free ware <License Value="free ware
"/> "/>
<Version Major="2" Minor="1" Release="2" Build="105"/> <Version Major="2" Minor="1" Release="2" Build="105"/>
<Files Count="55"> <Files Count="57">
<Item1> <Item1>
<Filename Value="rxlookup.pas"/> <Filename Value="rxlookup.pas"/>
<UnitName Value="rxlookup"/> <UnitName Value="rxlookup"/>
@@ -240,7 +240,7 @@ translate to Lazarus by alexs in 2005 - 2009
</Item52> </Item52>
<Item53> <Item53>
<Filename Value="rxaboutformunit.pas"/> <Filename Value="rxaboutformunit.pas"/>
<UnitName Value="rxaboutformunit"/> <UnitName Value="rxAboutFormUnit"/>
</Item53> </Item53>
<Item54> <Item54>
<Filename Value="dbcurredit.pas"/> <Filename Value="dbcurredit.pas"/>
@@ -250,6 +250,15 @@ translate to Lazarus by alexs in 2005 - 2009
<Filename Value="rxviewspanel.pas"/> <Filename Value="rxviewspanel.pas"/>
<UnitName Value="RxViewsPanel"/> <UnitName Value="RxViewsPanel"/>
</Item55> </Item55>
<Item56>
<Filename Value="rxsystemservices.pas"/>
<UnitName Value="RxSystemServices"/>
</Item56>
<Item57>
<Filename Value="registerrxtools.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="registerrxtools"/>
</Item57>
</Files> </Files>
<LazDoc Paths="docs\;\usr\local\share\lazarus\components\rxnew\docs\"/> <LazDoc Paths="docs\;\usr\local\share\lazarus\components\rxnew\docs\"/>
<i18n> <i18n>

View File

@@ -15,7 +15,8 @@ uses
rxsortmemds, AutoPanel, pickdate, rxiconv, rxceEditLookupFields, rxclock, rxsortmemds, AutoPanel, pickdate, rxiconv, rxceEditLookupFields, rxclock,
rxspin, RxDBSpinEdit, RegisterRxDB, RxTimeEdit, RxDBTimeEdit, RxDBCtrls, rxspin, RxDBSpinEdit, RegisterRxDB, RxTimeEdit, RxDBTimeEdit, RxDBCtrls,
rxfilterby, rxconst, rxFileUtils, RxVersInfo, RxAboutDialog, rxfilterby, rxconst, rxFileUtils, RxVersInfo, RxAboutDialog,
rxAboutFormUnit, dbcurredit, RxViewsPanel, LazarusPackageIntf; rxAboutFormUnit, dbcurredit, RxViewsPanel, RxSystemServices,
RegisterRxTools, LazarusPackageIntf;
implementation implementation
@@ -23,6 +24,7 @@ procedure Register;
begin begin
RegisterUnit('registerrx', @registerrx.Register); RegisterUnit('registerrx', @registerrx.Register);
RegisterUnit('RegisterRxDB', @RegisterRxDB.Register); RegisterUnit('RegisterRxDB', @RegisterRxDB.Register);
RegisterUnit('RegisterRxTools', @RegisterRxTools.Register);
end; end;
initialization initialization

View File

@@ -0,0 +1,112 @@
unit RxSystemServices;
{$mode objfpc}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs;
type
TRxServiceType = (sstAll, sstService, sstDrivers);
TRxServiceStatus = (sssAll, sssActive, sssInactive);
TRxServiceState = (srsStoped, //SERVICE_STOPPED : S := 'Сервис не запущен'
srsStartPending, //SERVICE_START_PENDING : S := 'Сервис в процессе запуска';
srsStopPending, //SERVICE_STOP_PENDING : S := 'Сервис в процессе завершения';
srsRunning, //SERVICE_RUNNING : S := 'Сервис запущен';
srsContinuePending, //SERVICE_CONTINUE_PENDING : S := 'Сервис в процессе запуска после временной оснановки';
srsPausePending, //SERVICE_PAUSE_PENDING : S := 'Сервис в процессе временной оснановки';
srsPaused //SERVICE_PAUSED : S := 'Сервис временно оснановлен';
);
TRxServiceItem = record
Name:string;
Description:string;
Status:TRxServiceState;
end;
type
{ TRxSystemServices }
TRxSystemServices = class(TComponent)
private
FItemCount: integer;
FServerName: string;
FServiceStatus: TRxServiceStatus;
FServiceType: TRxServiceType;
function GetItems(Index: integer): TRxServiceItem;
procedure SetItemCount(const AValue: integer);
procedure SetItems(Index: integer; const AValue: TRxServiceItem);
procedure SetServerName(const AValue: string);
procedure SetServiceStatus(const AValue: TRxServiceStatus);
procedure SetServiceType(const AValue: TRxServiceType);
protected
procedure ClearItems;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property Items[Index:integer]:TRxServiceItem read GetItems write SetItems;
property ItemCount:integer read FItemCount write SetItemCount;
published
property ServerName:string read FServerName write SetServerName;
property ServiceType:TRxServiceType read FServiceType write SetServiceType; //(sstAll, sstService, sstDrivers);
property ServiceStatus:TRxServiceStatus read FServiceStatus write SetServiceStatus; //(sssAll, sssActive, sssInactive);
end;
implementation
{ TRxSystemServices }
procedure TRxSystemServices.SetServerName(const AValue: string);
begin
if FServerName=AValue then exit;
FServerName:=AValue;
end;
function TRxSystemServices.GetItems(Index: integer): TRxServiceItem;
begin
end;
procedure TRxSystemServices.SetItemCount(const AValue: integer);
begin
if FItemCount=AValue then exit;
FItemCount:=AValue;
end;
procedure TRxSystemServices.SetItems(Index: integer;
const AValue: TRxServiceItem);
begin
end;
procedure TRxSystemServices.SetServiceStatus(const AValue: TRxServiceStatus);
begin
if FServiceStatus=AValue then exit;
FServiceStatus:=AValue;
end;
procedure TRxSystemServices.SetServiceType(const AValue: TRxServiceType);
begin
if FServiceType=AValue then exit;
FServiceType:=AValue;
end;
procedure TRxSystemServices.ClearItems;
begin
FItemCount:=0;
end;
constructor TRxSystemServices.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
destructor TRxSystemServices.Destroy;
begin
ClearItems;
inherited Destroy;
end;
end.

View File

@@ -38,7 +38,7 @@ interface
uses uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls, Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Buttons, StdCtrls; Buttons, StdCtrls, LCLType;
type type
TRxViewsPanel = class; TRxViewsPanel = class;
@@ -54,11 +54,15 @@ type
FLabel:TLabel; FLabel:TLabel;
function GetAction: TBasicAction; function GetAction: TBasicAction;
function GetCaption: string; function GetCaption: string;
function GetEnabled: Boolean;
function GetHint: TTranslateString;
function GetImageIndex: integer; function GetImageIndex: integer;
function GetTag: Longint; function GetTag: Longint;
function GetVisible: boolean; function GetVisible: boolean;
procedure SetAction(const AValue: TBasicAction); procedure SetAction(const AValue: TBasicAction);
procedure SetCaption(const AValue: string); procedure SetCaption(const AValue: string);
procedure SetEnabled(const AValue: Boolean);
procedure SetHint(const AValue: TTranslateString);
procedure SetImageIndex(const AValue: integer); procedure SetImageIndex(const AValue: integer);
procedure SetTag(const AValue: Longint); procedure SetTag(const AValue: Longint);
procedure SetVisible(const AValue: boolean); procedure SetVisible(const AValue: boolean);
@@ -76,6 +80,8 @@ type
property Caption:string read GetCaption Write SetCaption; property Caption:string read GetCaption Write SetCaption;
property Tag: Longint read GetTag write SetTag default 0; property Tag: Longint read GetTag write SetTag default 0;
property ImageIndex:integer read GetImageIndex write SetImageIndex; property ImageIndex:integer read GetImageIndex write SetImageIndex;
property Hint:TTranslateString read GetHint write SetHint;
property Enabled: Boolean read GetEnabled write SetEnabled default True;
end; end;
@@ -224,6 +230,7 @@ end;
procedure TRxViewsPanel.InternalSelectView(Item: TRxViewsPanelItem); procedure TRxViewsPanel.InternalSelectView(Item: TRxViewsPanelItem);
begin begin
FItemIndex:=Item.Index;
if Assigned(FOnSelectViewEvent) then if Assigned(FOnSelectViewEvent) then
FOnSelectViewEvent(Item.Index, Item); FOnSelectViewEvent(Item.Index, Item);
end; end;
@@ -267,6 +274,16 @@ begin
Result:=FLabel.Caption; Result:=FLabel.Caption;
end; end;
function TRxViewsPanelItem.GetEnabled: Boolean;
begin
Result:=FButton.Enabled;
end;
function TRxViewsPanelItem.GetHint: TTranslateString;
begin
Result:=FButton.Hint;
end;
function TRxViewsPanelItem.GetImageIndex: integer; function TRxViewsPanelItem.GetImageIndex: integer;
begin begin
{ if Assigned(FButton.Action) then { if Assigned(FButton.Action) then
@@ -295,6 +312,17 @@ begin
FLabel.Caption:=AValue; FLabel.Caption:=AValue;
end; end;
procedure TRxViewsPanelItem.SetEnabled(const AValue: Boolean);
begin
FButton.Enabled:=AValue;
FLabel.Enabled:=AValue;
end;
procedure TRxViewsPanelItem.SetHint(const AValue: TTranslateString);
begin
FButton.Hint:=AValue;
end;
procedure TRxViewsPanelItem.SetImageIndex(const AValue: integer); procedure TRxViewsPanelItem.SetImageIndex(const AValue: integer);
begin begin
if FImageIndex=AValue then exit; if FImageIndex=AValue then exit;