You've already forked lazarus-ccr
RxMDI - fix MDIForm.ActiveControl on change MDI windows
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2752 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -207,7 +207,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
for I := 1 to Length(Value) do
|
for I := 1 to Length(Value) do
|
||||||
if not (Value[I] in [DecimalSeparator, '-', '+', '0'..'9', 'e', 'E']) then
|
if not (Value[I] in [DefaultFormatSettings.DecimalSeparator, '-', '+', '0'..'9', 'e', 'E']) then
|
||||||
Exit;
|
Exit;
|
||||||
Result := TextToFloat(StrPLCopy(Buffer, Value,
|
Result := TextToFloat(StrPLCopy(Buffer, Value,
|
||||||
SizeOf(Buffer) - 1), RetValue, fvExtended);
|
SizeOf(Buffer) - 1), RetValue, fvExtended);
|
||||||
@ -223,7 +223,7 @@ begin
|
|||||||
IsSign := (MaxSym > 0) and (S[1] in ['-', '+']);
|
IsSign := (MaxSym > 0) and (S[1] in ['-', '+']);
|
||||||
if IsSign then MinSym := 2
|
if IsSign then MinSym := 2
|
||||||
else MinSym := 1;
|
else MinSym := 1;
|
||||||
I := Pos(DecimalSeparator, S);
|
I := Pos(DefaultFormatSettings.DecimalSeparator, S);
|
||||||
if I > 0 then MaxSym := I - 1;
|
if I > 0 then MaxSym := I - 1;
|
||||||
I := Pos('E', AnsiUpperCase(S));
|
I := Pos('E', AnsiUpperCase(S));
|
||||||
if I > 0 then MaxSym := Min(I - 1, MaxSym);
|
if I > 0 then MaxSym := Min(I - 1, MaxSym);
|
||||||
@ -234,7 +234,7 @@ begin
|
|||||||
Inc(Group);
|
Inc(Group);
|
||||||
if (Group = 3) and Thousands and (I > MinSym) then begin
|
if (Group = 3) and Thousands and (I > MinSym) then begin
|
||||||
Group := 0;
|
Group := 0;
|
||||||
Result := ThousandSeparator + Result;
|
Result := DefaultFormatSettings.ThousandSeparator + Result;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if IsSign then Result := S[1] + Result;
|
if IsSign then Result := S[1] + Result;
|
||||||
@ -415,13 +415,13 @@ end;
|
|||||||
function TCustomNumEdit.TextToValText(const AValue: string): string;
|
function TCustomNumEdit.TextToValText(const AValue: string): string;
|
||||||
begin
|
begin
|
||||||
Result := Trim(AValue);
|
Result := Trim(AValue);
|
||||||
if DecimalSeparator <> ThousandSeparator then begin
|
if DefaultFormatSettings.DecimalSeparator <> DefaultFormatSettings.ThousandSeparator then begin
|
||||||
Result := DelChars(Result, ThousandSeparator);
|
Result := DelChars(Result, ThousandSeparator);
|
||||||
end;
|
end;
|
||||||
if (DecimalSeparator <> '.') and (ThousandSeparator <> '.') then
|
if (DefaultFormatSettings.DecimalSeparator <> '.') and (DefaultFormatSettings.ThousandSeparator <> '.') then
|
||||||
Result := StringReplace(Result, '.', DecimalSeparator, [rfReplaceAll]);
|
Result := StringReplace(Result, '.', DefaultFormatSettings.DecimalSeparator, [rfReplaceAll]);
|
||||||
if (DecimalSeparator <> ',') and (ThousandSeparator <> ',') then
|
if (DefaultFormatSettings.DecimalSeparator <> ',') and (DefaultFormatSettings.ThousandSeparator <> ',') then
|
||||||
Result := StringReplace(Result, ',', DecimalSeparator, [rfReplaceAll]);
|
Result := StringReplace(Result, ',', DefaultFormatSettings.DecimalSeparator, [rfReplaceAll]);
|
||||||
if Result = '' then Result := '0'
|
if Result = '' then Result := '0'
|
||||||
else if Result = '-' then Result := '-0';
|
else if Result = '-' then Result := '-0';
|
||||||
end;
|
end;
|
||||||
@ -623,8 +623,8 @@ begin
|
|||||||
THack(FPopup).KeyPress(Key);
|
THack(FPopup).KeyPress(Key);
|
||||||
Key := #0;
|
Key := #0;
|
||||||
end;}
|
end;}
|
||||||
if Key in ['.', ','] - [ThousandSeparator] then
|
if Key in ['.', ','] - [DefaultFormatSettings.ThousandSeparator] then
|
||||||
Key := DecimalSeparator;
|
Key := DefaultFormatSettings.DecimalSeparator;
|
||||||
inherited KeyPress(Key);
|
inherited KeyPress(Key);
|
||||||
if (Key in [#32..#255]) and not IsValidChar(Key) then
|
if (Key in [#32..#255]) and not IsValidChar(Key) then
|
||||||
begin
|
begin
|
||||||
@ -650,7 +650,7 @@ begin
|
|||||||
System.Delete(S, ASelStart + 1, SelStop - ASelStart);
|
System.Delete(S, ASelStart + 1, SelStop - ASelStart);
|
||||||
System.Insert(Key, S, ASelStart + 1);
|
System.Insert(Key, S, ASelStart + 1);
|
||||||
S := TextToValText(S);
|
S := TextToValText(S);
|
||||||
DecPos := Pos(DecimalSeparator, S);
|
DecPos := Pos(DefaultFormatSettings.DecimalSeparator, S);
|
||||||
if (DecPos > 0) then
|
if (DecPos > 0) then
|
||||||
begin
|
begin
|
||||||
ASelStart := Pos('E', UpperCase(S));
|
ASelStart := Pos('E', UpperCase(S));
|
||||||
@ -661,7 +661,7 @@ begin
|
|||||||
if DecPos > Integer(FDecimalPlaces) then
|
if DecPos > Integer(FDecimalPlaces) then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
if S[1] = DecimalSeparator then
|
if S[1] = DefaultFormatSettings.DecimalSeparator then
|
||||||
s := '0' + s;
|
s := '0' + s;
|
||||||
end;
|
end;
|
||||||
Result := IsValidFloat(S, RetValue);
|
Result := IsValidFloat(S, RetValue);
|
||||||
@ -690,11 +690,11 @@ var
|
|||||||
I: Integer;
|
I: Integer;
|
||||||
C: Char;
|
C: Char;
|
||||||
begin
|
begin
|
||||||
Result := ',0.' + DupeString('0', CurrencyDecimals);
|
Result := ',0.' + DupeString('0', DefaultFormatSettings.CurrencyDecimals);
|
||||||
CurrStr := '';
|
CurrStr := '';
|
||||||
for I := 1 to Length(CurrencyString) do
|
for I := 1 to Length(DefaultFormatSettings.CurrencyString) do
|
||||||
begin
|
begin
|
||||||
C := CurrencyString[I];
|
C := DefaultFormatSettings.CurrencyString[I];
|
||||||
if C in [',', '.'] then
|
if C in [',', '.'] then
|
||||||
begin
|
begin
|
||||||
CurrStr := CurrStr + '''' + C + ''''
|
CurrStr := CurrStr + '''' + C + ''''
|
||||||
@ -702,7 +702,7 @@ begin
|
|||||||
else CurrStr := CurrStr + C;
|
else CurrStr := CurrStr + C;
|
||||||
end;
|
end;
|
||||||
if Length(CurrStr) > 0 then
|
if Length(CurrStr) > 0 then
|
||||||
case CurrencyFormat of
|
case DefaultFormatSettings.CurrencyFormat of
|
||||||
0: Result := CurrStr + Result; { '$1' }
|
0: Result := CurrStr + Result; { '$1' }
|
||||||
1: Result := Result + CurrStr; { '1$' }
|
1: Result := Result + CurrStr; { '1$' }
|
||||||
2: Result := CurrStr + ' ' + Result; { '$ 1' }
|
2: Result := CurrStr + ' ' + Result; { '$ 1' }
|
||||||
|
@ -434,10 +434,8 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
Y := 0; M := 0; D := 0;
|
Y := 0; M := 0; D := 0;
|
||||||
DateOrder := GetDateOrder(DateFormat);
|
DateOrder := GetDateOrder(DateFormat);
|
||||||
{$IFDEF RX_D3}
|
if DefaultFormatSettings.ShortDateFormat[1] = 'g' then { skip over prefix text }
|
||||||
if ShortDateFormat[1] = 'g' then { skip over prefix text }
|
|
||||||
ScanToNumber(S, Pos);
|
ScanToNumber(S, Pos);
|
||||||
{$ENDIF RX_D3}
|
|
||||||
if not (ScanNumber(S, MaxInt, Pos, N1) and ScanChar(S, Pos, DateSeparator) and
|
if not (ScanNumber(S, MaxInt, Pos, N1) and ScanChar(S, Pos, DateSeparator) and
|
||||||
ScanNumber(S, MaxInt, Pos, N2)) then Exit;
|
ScanNumber(S, MaxInt, Pos, N2)) then Exit;
|
||||||
if ScanChar(S, Pos, DateSeparator) then begin
|
if ScanChar(S, Pos, DateSeparator) then begin
|
||||||
|
@ -636,7 +636,7 @@ begin
|
|||||||
OldNotify := TStringList(FShortDaysOfWeek).OnChange;
|
OldNotify := TStringList(FShortDaysOfWeek).OnChange;
|
||||||
TStringList(FShortDaysOfWeek).OnChange := nil;
|
TStringList(FShortDaysOfWeek).OnChange := nil;
|
||||||
for Ind := 1 to 7 do
|
for Ind := 1 to 7 do
|
||||||
FShortDaysOfWeek.Add(SysUtils.ShortDayNames[Ind]);
|
FShortDaysOfWeek.Add(DefaultFormatSettings.ShortDayNames[Ind]);
|
||||||
TStringList(FShortDaysOfWeek).OnChange := OldNotify;
|
TStringList(FShortDaysOfWeek).OnChange := OldNotify;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -953,8 +953,8 @@ begin
|
|||||||
FMonthNames := TStringList.Create;
|
FMonthNames := TStringList.Create;
|
||||||
if FMonthNames.Count = 0 then
|
if FMonthNames.Count = 0 then
|
||||||
begin
|
begin
|
||||||
for i := Low(LongMonthNames) to High(LongMonthNames) do
|
for i := Low(DefaultFormatSettings.LongMonthNames) to High(DefaultFormatSettings.LongMonthNames) do
|
||||||
FMonthNames.Add(LongMonthNames[i]);
|
FMonthNames.Add(DefaultFormatSettings.LongMonthNames[i]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
BackPanel := TPanel.Create(Self);
|
BackPanel := TPanel.Create(Self);
|
||||||
@ -1204,7 +1204,7 @@ var
|
|||||||
AYear, AMonth, ADay: Word;
|
AYear, AMonth, ADay: Word;
|
||||||
begin
|
begin
|
||||||
DecodeDate(FCalendar.CalendarDate, AYear, AMonth, ADay);
|
DecodeDate(FCalendar.CalendarDate, AYear, AMonth, ADay);
|
||||||
FTitleLabel.Caption := Format('%s, %d', [LongMonthNames[AMonth], AYear]);
|
FTitleLabel.Caption := Format('%s, %d', [DefaultFormatSettings.LongMonthNames[AMonth], AYear]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPopupCalendar.SetDate(const AValue: TDateTime);
|
procedure TPopupCalendar.SetDate(const AValue: TDateTime);
|
||||||
@ -1214,7 +1214,8 @@ end;
|
|||||||
|
|
||||||
procedure TPopupCalendar.SetMonthNames(const AValue: TStrings);
|
procedure TPopupCalendar.SetMonthNames(const AValue: TStrings);
|
||||||
begin
|
begin
|
||||||
if AValue.Text <> FMonthNames.Text then begin
|
if AValue.Text <> FMonthNames.Text then
|
||||||
|
begin
|
||||||
FMonthNames.Assign(AValue);
|
FMonthNames.Assign(AValue);
|
||||||
CalendarChange(Self);
|
CalendarChange(Self);
|
||||||
end;
|
end;
|
||||||
@ -1558,7 +1559,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if StrDate <> '' then begin
|
if StrDate <> '' then begin
|
||||||
try
|
try
|
||||||
DateValue := StrToDateFmt(ShortDateFormat, StrDate);
|
DateValue := StrToDateFmt(DefaultFormatSettings.ShortDateFormat, StrDate);
|
||||||
except
|
except
|
||||||
DateValue := Date;
|
DateValue := Date;
|
||||||
end;
|
end;
|
||||||
@ -1566,7 +1567,7 @@ begin
|
|||||||
else DateValue := Date;
|
else DateValue := Date;
|
||||||
Result := SelectDate(DateValue, DlgCaption, AStartOfWeek, AWeekends,
|
Result := SelectDate(DateValue, DlgCaption, AStartOfWeek, AWeekends,
|
||||||
AWeekendColor, BtnHints);
|
AWeekendColor, BtnHints);
|
||||||
if Result then StrDate := FormatDateTime(ShortDateFormat, DateValue);
|
if Result then StrDate := FormatDateTime(DefaultFormatSettings.ShortDateFormat, DateValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TRxCalendarGrid }
|
{ TRxCalendarGrid }
|
||||||
|
@ -244,8 +244,8 @@ procedure InvalidTime(Hour, Min, Sec: Word);
|
|||||||
var
|
var
|
||||||
sTime: string[50];
|
sTime: string[50];
|
||||||
begin
|
begin
|
||||||
sTime := IntToStr(Hour) + TimeSeparator + IntToStr(Min) +
|
sTime := IntToStr(Hour) + DefaultFormatSettings.TimeSeparator + IntToStr(Min) +
|
||||||
TimeSeparator + IntToStr(Sec);
|
DefaultFormatSettings.TimeSeparator + IntToStr(Sec);
|
||||||
raise EConvertError.CreateFmt(SInvalidTime, [sTime]);
|
raise EConvertError.CreateFmt(SInvalidTime, [sTime]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -488,9 +488,9 @@ begin
|
|||||||
TimeStr := '88888';
|
TimeStr := '88888';
|
||||||
if FShowSeconds then TimeStr := TimeStr + '888';
|
if FShowSeconds then TimeStr := TimeStr + '888';
|
||||||
if FTwelveHour then begin
|
if FTwelveHour then begin
|
||||||
if Canvas.TextWidth(TimeAMString) > Canvas.TextWidth(TimePMString) then
|
if Canvas.TextWidth(DefaultFormatSettings.TimeAMString) > Canvas.TextWidth(DefaultFormatSettings.TimePMString) then
|
||||||
TimeStr := TimeStr + ' ' + TimeAMString
|
TimeStr := TimeStr + ' ' + DefaultFormatSettings.TimeAMString
|
||||||
else TimeStr := TimeStr + ' ' + TimePMString;
|
else TimeStr := TimeStr + ' ' + DefaultFormatSettings.TimePMString;
|
||||||
end;
|
end;
|
||||||
SetNewFontSize(Canvas, TimeStr, H, W);
|
SetNewFontSize(Canvas, TimeStr, H, W);
|
||||||
Font := Canvas.Font;
|
Font := Canvas.Font;
|
||||||
|
@ -35,6 +35,7 @@ type
|
|||||||
TRxMDIButton = class(TSpeedButton)
|
TRxMDIButton = class(TSpeedButton)
|
||||||
private
|
private
|
||||||
FNavForm: TForm;
|
FNavForm: TForm;
|
||||||
|
FActiveControl:TWinControl;
|
||||||
FNavPanel:TRxMDITasks;
|
FNavPanel:TRxMDITasks;
|
||||||
FSaveClose:TCloseEvent;
|
FSaveClose:TCloseEvent;
|
||||||
procedure SetRxMDIForm(AValue: TForm);
|
procedure SetRxMDIForm(AValue: TForm);
|
||||||
@ -115,11 +116,14 @@ type
|
|||||||
procedure navCloseButtonClick(Sender: TObject);
|
procedure navCloseButtonClick(Sender: TObject);
|
||||||
procedure SetRxMDICloseButton(AValue: TRxMDICloseButton);
|
procedure SetRxMDICloseButton(AValue: TRxMDICloseButton);
|
||||||
procedure SetTaskPanel(AValue: TRxMDITasks);
|
procedure SetTaskPanel(AValue: TRxMDITasks);
|
||||||
|
function MDIButtonByForm(AForm:TForm):TRxMDIButton;
|
||||||
|
procedure HideCurrentWindow;
|
||||||
protected
|
protected
|
||||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
procedure Loaded; override;
|
procedure Loaded; override;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
|
destructor Destroy; override;
|
||||||
procedure ShowWindow(F:TForm);
|
procedure ShowWindow(F:TForm);
|
||||||
|
|
||||||
procedure ChildWindowsAdd(F:TForm);
|
procedure ChildWindowsAdd(F:TForm);
|
||||||
@ -244,7 +248,7 @@ begin
|
|||||||
FCurrentChildWindow.Close;
|
FCurrentChildWindow.Close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRxMDIPanel.SeTRxMDICloseButton(AValue: TRxMDICloseButton);
|
procedure TRxMDIPanel.SetRxMDICloseButton(AValue: TRxMDICloseButton);
|
||||||
begin
|
begin
|
||||||
if FCloseButton=AValue then Exit;
|
if FCloseButton=AValue then Exit;
|
||||||
if Assigned(FCloseButton) then
|
if Assigned(FCloseButton) then
|
||||||
@ -270,6 +274,36 @@ begin
|
|||||||
FTaskPanel.FMainPanel:=Self;
|
FTaskPanel.FMainPanel:=Self;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TRxMDIPanel.MDIButtonByForm(AForm: TForm): TRxMDIButton;
|
||||||
|
var
|
||||||
|
i:integer;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
if not Assigned(FTaskPanel) then
|
||||||
|
exit;
|
||||||
|
for i:=0 to FTaskPanel.ComponentCount -1 do
|
||||||
|
begin
|
||||||
|
if (FTaskPanel.Components[i] is TRxMDIButton) and (TRxMDIButton(FTaskPanel.Components[i]).NavForm = AForm) then
|
||||||
|
begin
|
||||||
|
Result:=TRxMDIButton(FTaskPanel.Components[i]);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRxMDIPanel.HideCurrentWindow;
|
||||||
|
var
|
||||||
|
MB:TRxMDIButton;
|
||||||
|
begin
|
||||||
|
if Assigned(FCurrentChildWindow) and (FCurrentChildWindow.Visible) then
|
||||||
|
begin
|
||||||
|
MB:=MDIButtonByForm(FCurrentChildWindow);
|
||||||
|
if Assigned(MB) then
|
||||||
|
MB.FActiveControl:=Application.MainForm.ActiveControl;
|
||||||
|
FCurrentChildWindow.Hide;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TRxMDIPanel.Notification(AComponent: TComponent; Operation: TOperation
|
procedure TRxMDIPanel.Notification(AComponent: TComponent; Operation: TOperation
|
||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
@ -295,6 +329,11 @@ begin
|
|||||||
BevelOuter:=bvLowered;
|
BevelOuter:=bvLowered;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TRxMDIPanel.Destroy;
|
||||||
|
begin
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TRxMDIPanel.ShowWindow(F: TForm);
|
procedure TRxMDIPanel.ShowWindow(F: TForm);
|
||||||
begin
|
begin
|
||||||
TaskPanel.ShowWindow(F);
|
TaskPanel.ShowWindow(F);
|
||||||
@ -304,6 +343,7 @@ procedure TRxMDIPanel.ChildWindowsAdd(F: TForm);
|
|||||||
var
|
var
|
||||||
B:TRxMDIButton;
|
B:TRxMDIButton;
|
||||||
begin
|
begin
|
||||||
|
HideCurrentWindow;
|
||||||
F.BorderStyle:=bsNone;
|
F.BorderStyle:=bsNone;
|
||||||
F.Align:=alClient;
|
F.Align:=alClient;
|
||||||
F.Parent:=Self;
|
F.Parent:=Self;
|
||||||
@ -312,6 +352,7 @@ begin
|
|||||||
Application.MainForm.ActiveControl:=F;
|
Application.MainForm.ActiveControl:=F;
|
||||||
|
|
||||||
B:=TRxMDIButton.CreateButton(TaskPanel, F);
|
B:=TRxMDIButton.CreateButton(TaskPanel, F);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRxMDIPanel.ChildWindowsCreate(var AForm; FC: TFormClass);
|
procedure TRxMDIPanel.ChildWindowsCreate(var AForm; FC: TFormClass);
|
||||||
@ -320,6 +361,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if not Assigned(FForm) then
|
if not Assigned(FForm) then
|
||||||
begin
|
begin
|
||||||
|
HideCurrentWindow;
|
||||||
FForm:=FC.Create(Self);
|
FForm:=FC.Create(Self);
|
||||||
ChildWindowsAdd(FForm);
|
ChildWindowsAdd(FForm);
|
||||||
end
|
end
|
||||||
@ -568,29 +610,16 @@ begin
|
|||||||
if Assigned(FNavForm) then
|
if Assigned(FNavForm) then
|
||||||
begin
|
begin
|
||||||
FSaveClose:=FNavForm.OnClose;
|
FSaveClose:=FNavForm.OnClose;
|
||||||
|
//FSaveDeactivate:=FNavForm.OnDeactivate;
|
||||||
FNavForm.OnClose:=@FormClose;
|
FNavForm.OnClose:=@FormClose;
|
||||||
|
//FNavForm.OnDeactivate:=@FormDeactivate;
|
||||||
|
|
||||||
Caption:=' '+FNavForm.Caption+' ';
|
Caption:=' '+FNavForm.Caption+' ';
|
||||||
DoCreateButtonImage;
|
DoCreateButtonImage;
|
||||||
|
|
||||||
if Assigned(FNavPanel) then
|
if Assigned(FNavPanel) then
|
||||||
FNavPanel.FMainPanel.CurrentChildWindow:=NavForm;
|
FNavPanel.FMainPanel.CurrentChildWindow:=NavForm;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ if NavForm is TfbmDBObjectEditorForm then
|
|
||||||
begin
|
|
||||||
B:=TBitmap.Create;
|
|
||||||
try
|
|
||||||
B.Width:=fbManagerMainForm.ImageList2.Width;
|
|
||||||
B.Height:=fbManagerMainForm.ImageList2.Height;
|
|
||||||
B.Canvas.Brush.Color:=Color;
|
|
||||||
B.Canvas.FillRect(0,0, B.Width, B.Height);
|
|
||||||
FImageIndex:=ord(TfbmDBObjectEditorForm(NavForm).DBObject.DBObjectKind) + 2;
|
|
||||||
fbManagerMainForm.ImageList2.Draw(B.Canvas, 0,0,FImageIndex);
|
|
||||||
Glyph.Assign(B);
|
|
||||||
finally
|
|
||||||
B.Free;
|
|
||||||
end;
|
|
||||||
end;}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TRxMDIButton.DoCreateMenuItems;
|
procedure TRxMDIButton.DoCreateMenuItems;
|
||||||
@ -704,9 +733,13 @@ begin
|
|||||||
inherited Click;
|
inherited Click;
|
||||||
if Assigned(FNavForm) then
|
if Assigned(FNavForm) then
|
||||||
begin
|
begin
|
||||||
FNavForm.BringToFront;
|
FNavPanel.FMainPanel.HideCurrentWindow;
|
||||||
|
FNavForm.Show;
|
||||||
|
//FNavForm.BringToFront;
|
||||||
FNavPanel.FMainPanel.CurrentChildWindow:=NavForm;
|
FNavPanel.FMainPanel.CurrentChildWindow:=NavForm;
|
||||||
Application.MainForm.ActiveControl:=NavForm.ActiveControl;
|
//Application.MainForm.ActiveControl:=NavForm.ActiveControl;
|
||||||
|
if Assigned(FActiveControl) then
|
||||||
|
FActiveControl.SetFocus;
|
||||||
end;
|
end;
|
||||||
Down:=true;
|
Down:=true;
|
||||||
end;
|
end;
|
||||||
|
@ -64,7 +64,7 @@ type
|
|||||||
procedure TRxMemoryDataSortEngine.UpdateFooterRows(ADataSet: TDataSet;
|
procedure TRxMemoryDataSortEngine.UpdateFooterRows(ADataSet: TDataSet;
|
||||||
AGrid: TRxDBGrid);
|
AGrid: TRxDBGrid);
|
||||||
var
|
var
|
||||||
i, j:integer;
|
i:integer;
|
||||||
Col:TRxColumn;
|
Col:TRxColumn;
|
||||||
|
|
||||||
DHL:THackDataLink;
|
DHL:THackDataLink;
|
||||||
|
@ -692,8 +692,8 @@ var
|
|||||||
begin
|
begin
|
||||||
ValidChars := ['+', '-', '0'..'9'];
|
ValidChars := ['+', '-', '0'..'9'];
|
||||||
if ValueType = vtFloat then begin
|
if ValueType = vtFloat then begin
|
||||||
if Pos(DecimalSeparator, Text) = 0 then
|
if Pos(DefaultFormatSettings.DecimalSeparator, Text) = 0 then
|
||||||
ValidChars := ValidChars + [DecimalSeparator];
|
ValidChars := ValidChars + [DefaultFormatSettings.DecimalSeparator];
|
||||||
if Pos('E', AnsiUpperCase(Text)) = 0 then
|
if Pos('E', AnsiUpperCase(Text)) = 0 then
|
||||||
ValidChars := ValidChars + ['e', 'E'];
|
ValidChars := ValidChars + ['e', 'E'];
|
||||||
end
|
end
|
||||||
|
@ -224,7 +224,7 @@ begin
|
|||||||
else
|
else
|
||||||
if P < 6 then IncMin
|
if P < 6 then IncMin
|
||||||
else IncSec;
|
else IncSec;
|
||||||
Text:=Format('%2.2d'+ TimeSeparator +'%2.2d'+ TimeSeparator +'%2.2d', [H1, M2, S3]);
|
Text:=Format('%2.2d'+ DefaultFormatSettings.TimeSeparator +'%2.2d'+ DefaultFormatSettings.TimeSeparator +'%2.2d', [H1, M2, S3]);
|
||||||
SetSelStart(P);
|
SetSelStart(P);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ begin
|
|||||||
FButton.OnTopClick := @UpClick;
|
FButton.OnTopClick := @UpClick;
|
||||||
FButton.OnBottomClick := @DownClick;
|
FButton.OnBottomClick := @DownClick;
|
||||||
|
|
||||||
EditMask:='!#0'+TimeSeparator + '00'+TimeSeparator + '00;1;_';
|
EditMask:='!#0'+DefaultFormatSettings.TimeSeparator + '00'+DefaultFormatSettings.TimeSeparator + '00;1;_';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomRxTimeEdit.Destroy;
|
destructor TCustomRxTimeEdit.Destroy;
|
||||||
|
@ -215,7 +215,6 @@ type
|
|||||||
procedure Notification(AComponent: TComponent;
|
procedure Notification(AComponent: TComponent;
|
||||||
Operation: TOperation); override;
|
Operation: TOperation); override;
|
||||||
procedure SetCustomizing(AValue:boolean);
|
procedure SetCustomizing(AValue:boolean);
|
||||||
procedure DoAutoSize; Override;
|
|
||||||
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
|
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer); override;
|
X, Y: Integer); override;
|
||||||
procedure RequestAlign; override;
|
procedure RequestAlign; override;
|
||||||
@ -1086,36 +1085,6 @@ begin
|
|||||||
FToolbarItems[i].FButton.SetDesign(AValue, FToolbarItems[i]);
|
FToolbarItems[i].FButton.SetDesign(AValue, FToolbarItems[i]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TToolPanel.DoAutoSize;
|
|
||||||
var
|
|
||||||
i, H:integer;
|
|
||||||
|
|
||||||
begin
|
|
||||||
{
|
|
||||||
if not AutoSizeCanStart then exit;
|
|
||||||
if csDesigning in ComponentState then exit;
|
|
||||||
|
|
||||||
if Items.Count > 0 then
|
|
||||||
begin
|
|
||||||
try
|
|
||||||
H:=0;
|
|
||||||
for i:=0 to Items.Count-1 do
|
|
||||||
if Assigned(Items[i].FButton) and Items[i].FButton.HandleObjectShouldBeVisible then
|
|
||||||
H:=Max(H, Items[i].Height);
|
|
||||||
if H>0 then
|
|
||||||
begin
|
|
||||||
H:=H +BorderWidth * 2;
|
|
||||||
SetBoundsKeepBase(Left,Top,Width,H,true);
|
|
||||||
ReAlignToolBtn;
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
end
|
|
||||||
// Exclude(FControlFlags,cfAutoSizeNeeded);
|
|
||||||
end
|
|
||||||
else }
|
|
||||||
inherited DoAutoSize;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TToolPanel.MouseUp(Button: TMouseButton; Shift: TShiftState; X,
|
procedure TToolPanel.MouseUp(Button: TMouseButton; Shift: TShiftState; X,
|
||||||
Y: Integer);
|
Y: Integer);
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user