diff --git a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi index 48f6b7f52..4875cafc9 100644 --- a/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi +++ b/components/rx/trunk/Demos/RxDBGrid/RxDBGridDemo.lpi @@ -54,7 +54,7 @@ - + @@ -102,14 +102,15 @@ + - - + + - + @@ -192,24 +193,18 @@ - - - - + + - - - - @@ -507,25 +502,21 @@ - - + - - - - + + - @@ -836,135 +827,59 @@ - - + + + + + + + + + + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/rx/trunk/languages/rxdconst.es.po b/components/rx/trunk/languages/rxdconst.es.po index 425685b16..e297b7b49 100644 --- a/components/rx/trunk/languages/rxdconst.es.po +++ b/components/rx/trunk/languages/rxdconst.es.po @@ -75,8 +75,8 @@ msgstr "Campo '%s' no usado en expresión de filtro" #: rxdconst.sexprbadnulltest #, fuzzy -#| msgid "NULL-values enabled in '=' и '<>'" -msgid "NULL-values enabled in '=' и '<>'" +#| msgid "NULL-values enabled in '=' и '<>'" +msgid "NULL-values enabled in '=' и '<>'" msgstr "Valor nulo habilitado en '=' y '<>'" #: rxdconst.sexprexpected @@ -294,6 +294,15 @@ msgstr "Hacia Delante" msgid "Text to find" msgstr "Texto a Buscar" +#: rxdconst.srxdbgridselapplycaption +msgctxt "rxdconst.srxdbgridselapplycaption" +msgid "Apply" +msgstr "Aceptar" + +#: rxdconst.srxdbgridselapplyhint +msgid "Apply current columns setings" +msgstr "" + #: rxdconst.srxdbgridselcolcaption msgid "Grid columns" msgstr "Columnas de la Tabla" diff --git a/components/rx/trunk/languages/rxdconst.po b/components/rx/trunk/languages/rxdconst.po index 7061c42bf..b21287f86 100644 --- a/components/rx/trunk/languages/rxdconst.po +++ b/components/rx/trunk/languages/rxdconst.po @@ -74,7 +74,7 @@ msgid "Field '%s' not used in filter expression" msgstr "" #: rxdconst.sexprbadnulltest -msgid "NULL-values enabled in '=' и '<>'" +msgid "NULL-values enabled in '=' и '<>'" msgstr "" #: rxdconst.sexprexpected @@ -292,6 +292,15 @@ msgstr "" msgid "Text to find" msgstr "" +#: rxdconst.srxdbgridselapplycaption +msgctxt "rxdconst.srxdbgridselapplycaption" +msgid "Apply" +msgstr "" + +#: rxdconst.srxdbgridselapplyhint +msgid "Apply current columns setings" +msgstr "" + #: rxdconst.srxdbgridselcolcaption msgid "Grid columns" msgstr "" diff --git a/components/rx/trunk/languages/rxdconst.ru.po b/components/rx/trunk/languages/rxdconst.ru.po index 353cb1fbc..a530817cd 100644 --- a/components/rx/trunk/languages/rxdconst.ru.po +++ b/components/rx/trunk/languages/rxdconst.ru.po @@ -75,8 +75,8 @@ msgstr "Поле '%s' не может быть использовано в вы #: rxdconst.sexprbadnulltest #, fuzzy -#| msgid "NULL-values enabled in '=' и '<>'" -msgid "NULL-values enabled in '=' и '<>'" +#| msgid "NULL-values enabled in '=' и '<>'" +msgid "NULL-values enabled in '=' и '<>'" msgstr "NULL-значения разрешены только в выражениях '=' и '<>'" #: rxdconst.sexprexpected @@ -294,6 +294,15 @@ msgstr "Вперёд" msgid "Text to find" msgstr "Текст для поиска" +#: rxdconst.srxdbgridselapplycaption +msgctxt "rxdconst.srxdbgridselapplycaption" +msgid "Apply" +msgstr "Применить" + +#: rxdconst.srxdbgridselapplyhint +msgid "Apply current columns setings" +msgstr "" + #: rxdconst.srxdbgridselcolcaption msgid "Grid columns" msgstr "Поля таблицы" diff --git a/components/rx/trunk/languages/rxdconst.uk.po b/components/rx/trunk/languages/rxdconst.uk.po index da11fb9fa..ffc9a5b7c 100644 --- a/components/rx/trunk/languages/rxdconst.uk.po +++ b/components/rx/trunk/languages/rxdconst.uk.po @@ -84,8 +84,8 @@ msgstr "Поле '%s' не може бути використане в вира #: rxdconst.sexprbadnulltest #, fuzzy -#| msgid "NULL-values enabled in '=' и '<>'" -msgid "NULL-values enabled in '=' и '<>'" +#| msgid "NULL-values enabled in '=' и '<>'" +msgid "NULL-values enabled in '=' и '<>'" msgstr "NULL-значення дозволені тільки у виразах '=' і '<>'" #: rxdconst.sexprexpected @@ -303,6 +303,15 @@ msgstr "Вперед" msgid "Text to find" msgstr "Текст для пошуку" +#: rxdconst.srxdbgridselapplycaption +msgctxt "rxdconst.srxdbgridselapplycaption" +msgid "Apply" +msgstr "Застосувати" + +#: rxdconst.srxdbgridselapplyhint +msgid "Apply current columns setings" +msgstr "" + #: rxdconst.srxdbgridselcolcaption msgid "Grid columns" msgstr "Поля таблиці" diff --git a/components/rx/trunk/registerrx.pas b/components/rx/trunk/registerrx.pas index 5dd3ce198..f4b855e64 100644 --- a/components/rx/trunk/registerrx.pas +++ b/components/rx/trunk/registerrx.pas @@ -40,6 +40,7 @@ uses const RxCtrllPageName = 'RX Controls'; + RxToolsPageName = 'RX Tools'; procedure Register; @@ -49,7 +50,7 @@ uses curredit, rxswitch, rxdice, rxtoolbar, rxxpman, PageMngr, RxAppIcon, Dialogs, ComponentEditors, DBPropEdits, DB, rxctrls, RxCustomChartPanel, AutoPanel, pickdate, rxconst, tooledit, rxclock, - rxpopupunit, rxspin, RxTimeEdit, + rxpopupunit, rxspin, RxTimeEdit, rxDateRangeEditUnit, RxAboutDialog, RxViewsPanel, RxMDI; {$IFDEF USE_TRxAppIcon} @@ -159,7 +160,12 @@ end; procedure RegisterRxHistoryNavigator; begin - RegisterComponents('RX Tools',[TRxHistoryNavigator]); + RegisterComponents(RxToolsPageName,[TRxHistoryNavigator]); +end; + +procedure RegisterrxDateRangeEditUnit; +begin + RegisterComponents(RxCtrllPageName,[TRxDateRangeEdit]); end; procedure Register; @@ -190,6 +196,8 @@ begin RegisterUnit('RxViewsPanel', @RegisterRxViewsPanel); RegisterUnit('RxHistoryNavigator', @RegisterRxHistoryNavigator); RegisterUnit('RxMDI', @RegisterRxMDI); + RegisterUnit('rxDateRangeEditUnit', @RegisterrxDateRangeEditUnit); + end; initialization diff --git a/components/rx/trunk/rxdaterangeeditunit.pas b/components/rx/trunk/rxdaterangeeditunit.pas new file mode 100644 index 000000000..43254c6db --- /dev/null +++ b/components/rx/trunk/rxdaterangeeditunit.pas @@ -0,0 +1,230 @@ +unit rxDateRangeEditUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, types, Controls, Buttons, StdCtrls, Spin; + +type + + { TRxCustomDateRangeEdit } + + TRxCustomDateRangeEdit = class(TCustomControl) + private + FOnEditChange: TNotifyEvent; + FsbDecYear: TSpeedButton; + FsbDecMonth: TSpeedButton; + FsbIncYear: TSpeedButton; + FsbIncMonth: TSpeedButton; + FEditYear: TSpinEdit; + FEditMonth: TComboBox; + procedure DoIncMonth(Sender: TObject); + procedure DoIncYear(Sender: TObject); + procedure DoDecMonth(Sender: TObject); + procedure DoDecYear(Sender: TObject); + function GetMonth: word; + function GetPeriod: TDateTime; + function GetYear: word; + procedure SetMonth(AValue: word); + procedure SetPeriod(AValue: TDateTime); + procedure SetYear(AValue: word); + procedure InternalOnEditChange(Sender: TObject); + protected + class function GetControlClassDefaultSize: TSize; override; + procedure FillMonthNames; + procedure SetAutoSize(AValue: Boolean); override; + procedure EditChange; virtual; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + property Year:word read GetYear write SetYear; + property Month:word read GetMonth write SetMonth; + property Period:TDateTime read GetPeriod write SetPeriod; + property OnChange: TNotifyEvent read FOnEditChange write FOnEditChange; + end; + +type + TRxDateRangeEdit = class(TRxCustomDateRangeEdit) + published + property Autosize default True; + property Year; + property Month; + property OnChange; + end; + +implementation + +{ TRxCustomDateRangeEdit } + +procedure TRxCustomDateRangeEdit.DoIncMonth(Sender: TObject); +begin + if FEditMonth.ItemIndex < 11 then + FEditMonth.ItemIndex := FEditMonth.ItemIndex + 1 + else + begin + FEditMonth.ItemIndex := 0; + FEditYear.Value:=FEditYear.Value + 1; + end; +end; + +procedure TRxCustomDateRangeEdit.DoIncYear(Sender: TObject); +begin + FEditYear.Value:=FEditYear.Value + 1; +end; + +procedure TRxCustomDateRangeEdit.DoDecMonth(Sender: TObject); +begin + if FEditMonth.ItemIndex > 0 then + FEditMonth.ItemIndex := FEditMonth.ItemIndex - 1 + else + begin + FEditMonth.ItemIndex := 11; + FEditYear.Value:=FEditYear.Value - 1; + end; +end; + +procedure TRxCustomDateRangeEdit.DoDecYear(Sender: TObject); +begin + FEditYear.Value:=FEditYear.Value - 1; +end; + +function TRxCustomDateRangeEdit.GetMonth: word; +begin + Result:=FEditMonth.ItemIndex+1; +end; + +function TRxCustomDateRangeEdit.GetPeriod: TDateTime; +begin + Result:=EncodeDate(Year, Month, 1); +end; + +function TRxCustomDateRangeEdit.GetYear: word; +begin + Result:=FEditYear.Value; +end; + +procedure TRxCustomDateRangeEdit.SetMonth(AValue: word); +begin + if (AValue>0) and (AValue < 13) then + FEditMonth.ItemIndex:=AValue; +end; + +procedure TRxCustomDateRangeEdit.SetPeriod(AValue: TDateTime); +var + Y, M, D: word; +begin + DecodeDate(AValue, Y, M, D); + FEditMonth.ItemIndex:=M-1; + FEditYear.Value:=Y; +end; + +procedure TRxCustomDateRangeEdit.SetYear(AValue: word); +begin + FEditYear.Value:=AValue; +end; + +procedure TRxCustomDateRangeEdit.InternalOnEditChange(Sender: TObject); +begin + EditChange; +end; + +class function TRxCustomDateRangeEdit.GetControlClassDefaultSize: TSize; +begin + Result.CX := 80 + 70 + 23 * 4; + Result.CY := 23; +end; + +procedure TRxCustomDateRangeEdit.FillMonthNames; +var + i: Integer; +begin + for i:=1 to 12 do + FEditMonth.Items.Add(DefaultFormatSettings.LongMonthNames[i]); +end; + +procedure TRxCustomDateRangeEdit.SetAutoSize(AValue: Boolean); +begin + if AutoSize = AValue then + Exit; + inherited SetAutosize(AValue); + FEditMonth.AutoSize := AValue; + FEditYear.AutoSize := AValue; +end; + +procedure TRxCustomDateRangeEdit.EditChange; +begin + if Assigned(FOnEditChange) then FOnEditChange(Self); +end; + +constructor TRxCustomDateRangeEdit.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FEditYear:=TSpinEdit.Create(Self); + FEditMonth:=TComboBox.Create(Self); + FEditMonth.Style:=csDropDownList; + FEditYear.Width:=70; + FEditMonth.Width:=80; + + FsbDecYear:=TSpeedButton.Create(Self); + FsbDecMonth:=TSpeedButton.Create(Self); + FsbIncYear:=TSpeedButton.Create(Self); + FsbIncMonth:=TSpeedButton.Create(Self); + + FsbDecYear.OnClick:=@DoDecYear; + FsbDecMonth.OnClick:=@DoDecMonth; + FsbIncYear.OnClick:=@DoIncYear; + FsbIncMonth.OnClick:=@DoIncMonth; + + + FEditYear.Parent:=Self; + FsbDecYear.Parent:=Self; + FsbDecMonth.Parent:=Self; + FsbIncYear.Parent:=Self; + FsbIncMonth.Parent:=Self; + FEditMonth.Parent:=Self; + + FsbDecYear.Caption:='<<'; + FsbDecMonth.Caption:='<'; + FsbIncYear.Caption:='>>'; + FsbIncMonth.Caption:='>'; + + FsbDecYear.Left:=0; + FsbDecMonth.Left:=23; + FEditMonth.Left:=46; + FEditYear.Left:=126; + FsbIncMonth.Left:=206; + FsbIncYear.Left:=229; + + + ControlStyle := ControlStyle + [csNoFocus]; + + + FsbDecYear.Align:=alLeft; + FsbDecMonth.Align:=alLeft; + FsbIncYear.Align:=alRight; + FsbIncMonth.Align:=alRight; + + FEditYear.Align:=alRight; + FEditMonth.Align:=alClient; + + FEditYear.MaxValue:=9999; + with GetControlClassDefaultSize do + SetInitialBounds(0, 0, CX, CY); + FillMonthNames; + + SetPeriod(Now); + AutoSize := True; + + FEditMonth.OnChange:=@InternalOnEditChange; + FEditYear.OnChange:=@InternalOnEditChange; +end; + +destructor TRxCustomDateRangeEdit.Destroy; +begin + inherited Destroy; +end; + +end. + diff --git a/components/rx/trunk/rxmdi.pas b/components/rx/trunk/rxmdi.pas index 3a805e478..8cf3c6d16 100644 --- a/components/rx/trunk/rxmdi.pas +++ b/components/rx/trunk/rxmdi.pas @@ -345,6 +345,7 @@ procedure TRxMDIPanel.ChildWindowsAdd(F: TForm); var B:TRxMDIButton; begin + Assert(Assigned(TaskPanel), 'Нет связанной панели задач'); HideCurrentWindow; F.BorderStyle:=bsNone; F.Align:=alClient; diff --git a/components/rx/trunk/rxnew.lpk b/components/rx/trunk/rxnew.lpk index 134c9882a..acf63dc6d 100644 --- a/components/rx/trunk/rxnew.lpk +++ b/components/rx/trunk/rxnew.lpk @@ -17,9 +17,6 @@ - - - - + @@ -303,6 +300,10 @@ translate to Lazarus by alexs in 2005 - 2014 + + + + diff --git a/components/rx/trunk/rxnew.pas b/components/rx/trunk/rxnew.pas index 27beb9def..fcddd2d8b 100644 --- a/components/rx/trunk/rxnew.pas +++ b/components/rx/trunk/rxnew.pas @@ -18,7 +18,7 @@ uses RxTimeEdit, rxtoolbar, RxVersInfo, RxViewsPanel, rxxpman, seldsfrm, tooledit, vclutils, RxCloseFormValidator, RxHistoryNavigator, ex_rx_bin_datapacket, ex_rx_datapacket, ex_rx_xml_datapacket, rxsortby, - RxMDI, RxIniPropStorage, LazarusPackageIntf; + RxMDI, RxIniPropStorage, rxDateRangeEditUnit, LazarusPackageIntf; implementation