Fixed another small shortcut bug

Updated "Select color" dialog
Removed "Do not restore caret" property, not useful
This commit is contained in:
Christian Hammacher 2005-09-09 23:01:09 +00:00
parent e2a521583a
commit d95f2cba37
11 changed files with 185 additions and 211 deletions

View File

@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1 MajorVer=1
MinorVer=1 MinorVer=1
Release=0 Release=0
Build=12 Build=13
Debug=0 Debug=0
PreRelease=0 PreRelease=0
Special=0 Special=0
@ -126,7 +126,7 @@ CodePage=1252
[Version Info Keys] [Version Info Keys]
CompanyName=AMX Mod X Dev Team CompanyName=AMX Mod X Dev Team
FileDescription= FileDescription=
FileVersion=1.1.0.12 FileVersion=1.1.0.13
InternalName= InternalName=
LegalCopyright= LegalCopyright=
LegalTrademarks= LegalTrademarks=

Binary file not shown.

Binary file not shown.

View File

@ -482,11 +482,16 @@ begin
frmSelectColor.HSL.SelectedColor := Color; frmSelectColor.HSL.SelectedColor := Color;
frmSelectColor.chkDefault1.Checked := Color = clDefault; frmSelectColor.chkDefault1.Checked := Color = clDefault;
frmSelectColor.chkDefault2.Checked := Color = clDefault; frmSelectColor.chkDefault2.Checked := Color = clDefault;
frmSelectColor.chkNone1.Checked := Color = clNone;
frmSelectColor.chkNone2.Checked := Color = clNone;
frmSelectColor.OldSwatch.Color := Color; frmSelectColor.OldSwatch.Color := Color;
Result := frmSelectColor.ShowModal = mrOk; Result := frmSelectColor.ShowModal = mrOk;
if Result then begin if Result then begin
if frmSelectColor.chkDefault1.Checked then if frmSelectColor.chkDefault1.Checked then
Color := clDefault Color := clDefault
else if frmSelectColor.chkNone1.Checked then
Color := clNone
else else
Color := frmSelectColor.NewSwatch.Color; Color := frmSelectColor.NewSwatch.Color;
@ -580,8 +585,6 @@ var i: integer;
begin begin
//> INI-Values <// //> INI-Values <//
{ Tools } { Tools }
frmSettings.chkRestoreCaret.Checked := eConfig.ReadBool('Editor', 'LimitCaretRestore', True);
frmSettings.txtLines.Text := eConfig.ReadString('Editor', 'LimitCaretRestoreVal', '600');
frmSettings.txtDefaultName.Text := eConfig.ReadString('Misc', 'DefaultPluginName', 'New Plugin'); frmSettings.txtDefaultName.Text := eConfig.ReadString('Misc', 'DefaultPluginName', 'New Plugin');
frmSettings.txtDefaultVersion.Text := eConfig.ReadString('Misc', 'DefaultPluginVersion', '1.0'); frmSettings.txtDefaultVersion.Text := eConfig.ReadString('Misc', 'DefaultPluginVersion', '1.0');
frmSettings.txtDefaultAuthor.Text := eConfig.ReadString('Misc', 'DefaultPluginAuthor', 'Your name'); frmSettings.txtDefaultAuthor.Text := eConfig.ReadString('Misc', 'DefaultPluginAuthor', 'Your name');
@ -950,14 +953,9 @@ begin
frmMain.sciEditor.Modified := Document.Modified; frmMain.sciEditor.Modified := Document.Modified;
if RestoreCaret then begin if RestoreCaret then begin
if (eConfig.ReadBool('Editor', 'CheckRestoreCaret', True)) and (eConfig.ReadInteger('Editor', 'CheckRestoreLines', 600) < CountChars(Document.Code, #13)) then begin
Screen.Cursor := crDefault;
exit;
end;
frmMain.sciEditor.LineScroll(0, (0 - frmMain.sciEditor.GetFirstVisibleLine) + Document.TopLine);
frmMain.sciEditor.SelStart := Document.SelStart; frmMain.sciEditor.SelStart := Document.SelStart;
frmMain.sciEditor.SelLength := Document.SelLength; frmMain.sciEditor.SelLength := Document.SelLength;
frmMain.sciEditor.LineScroll(0, (0 - frmMain.sciEditor.GetFirstVisibleLine) + Document.TopLine);
end; end;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
Plugin_DocChange(Document.Index, Document.FileName, Document.Highlighter, RestoreCaret, False); Plugin_DocChange(Document.Index, Document.FileName, Document.Highlighter, RestoreCaret, False);

View File

@ -1,6 +1,6 @@
object frmMain: TfrmMain object frmMain: TfrmMain
Left = 260 Left = 260
Top = 195 Top = 305
Width = 888 Width = 888
Height = 640 Height = 640
Caption = 'AMXX-Studio' Caption = 'AMXX-Studio'

View File

@ -542,8 +542,6 @@ begin
eConfig.WriteBool('Editor', 'UnindentClosingBrace', frmAutoIndent.chkUnindentPressingClosingBrace.Checked); eConfig.WriteBool('Editor', 'UnindentClosingBrace', frmAutoIndent.chkUnindentPressingClosingBrace.Checked);
eConfig.WriteBool('Editor', 'UnindentEmptyLine', frmAutoIndent.chkUnindentLine.Checked); eConfig.WriteBool('Editor', 'UnindentEmptyLine', frmAutoIndent.chkUnindentLine.Checked);
{ Editor } { Editor }
eConfig.WriteBool('Editor', 'LimitCaretRestore', frmSettings.chkRestoreCaret.Checked);
eConfig.WriteString('Editor', 'LimitCaretRestoreVal', frmSettings.txtLines.Text);
if FileExists(sciPropertyLoader.FileName) then if FileExists(sciPropertyLoader.FileName) then
sciPropertyLoader.Save; sciPropertyLoader.Save;
{ Compiler } { Compiler }

Binary file not shown.

View File

@ -30,9 +30,11 @@ type
EBlue: TmbXPSpinEdit; EBlue: TmbXPSpinEdit;
NewSwatch: TmbColorPreview; NewSwatch: TmbColorPreview;
OldSwatch: TmbColorPreview; OldSwatch: TmbColorPreview;
chkDefault1: TCheckBox;
bvlSpace1: TBevel; bvlSpace1: TBevel;
bvlSpace2: TBevel; bvlSpace2: TBevel;
chkDefault1: TCheckBox;
chkNone1: TCheckBox;
chkNone2: TCheckBox;
chkDefault2: TCheckBox; chkDefault2: TCheckBox;
procedure ColorModelChange(Sender: TObject); procedure ColorModelChange(Sender: TObject);
procedure HSLChange(Sender: TObject); procedure HSLChange(Sender: TObject);
@ -47,7 +49,8 @@ type
function GetHint(c: TColor): string; function GetHint(c: TColor): string;
procedure SetAllToSel(c: TColor); procedure SetAllToSel(c: TColor);
procedure PagesChange(Sender: TObject); procedure PagesChange(Sender: TObject);
procedure chkDefault2Click(Sender: TObject); procedure checkMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
protected protected
procedure CreateParams(var Params: TCreateParams); override; procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override; procedure CreateWnd; override;
@ -76,190 +79,210 @@ end;
procedure TfrmSelectColor.ColorModelChange(Sender: TObject); procedure TfrmSelectColor.ColorModelChange(Sender: TObject);
begin begin
case ColorModel.ItemIndex of case ColorModel.ItemIndex of
0: 0:
begin begin
LRed.Caption := '&Red:'; LRed.Caption := '&Red:';
LGreen.Caption := '&Green:'; LGreen.Caption := '&Green:';
LBlue.Caption := '&Blue:'; LBlue.Caption := '&Blue:';
ERed.MaxValue := 255; ERed.MaxValue := 255;
EGreen.MaxValue := 255; EGreen.MaxValue := 255;
EBlue.MaxValue := 255; EBlue.MaxValue := 255;
ERed.Value := GetRValue(NewSwatch.Color); ERed.Value := GetRValue(NewSwatch.Color);
EGreen.Value := GetGValue(NewSwatch.Color); EGreen.Value := GetGValue(NewSwatch.Color);
EBlue.Value := GetBValue(NewSwatch.Color); EBlue.Value := GetBValue(NewSwatch.Color);
end; end;
1: 1:
begin begin
LRed.Caption := 'H&ue:'; LRed.Caption := 'H&ue:';
LGreen.Caption := '&Sat:'; LGreen.Caption := '&Sat:';
LBlue.Caption := '&Lum:'; LBlue.Caption := '&Lum:';
ERed.MaxValue := 238; ERed.MaxValue := 238;
EGreen.MaxValue := 240; EGreen.MaxValue := 240;
EBlue.MaxValue := 240; EBlue.MaxValue := 240;
RGBtoHSLRange(NewSwatch.Color, h, s, l); RGBtoHSLRange(NewSwatch.Color, h, s, l);
ERed.Value := h; ERed.Value := h;
EGreen.Value := s; EGreen.Value := s;
EBlue.Value := l; EBlue.Value := l;
end; end;
end; end;
end; end;
procedure TfrmSelectColor.HSLChange(Sender: TObject); procedure TfrmSelectColor.HSLChange(Sender: TObject);
begin begin
if HSL.Manual then if HSL.Manual then
case ColorModel.ItemIndex of case ColorModel.ItemIndex of
0: 0:
begin begin
ERed.Value := HSL.RValue; ERed.Value := HSL.RValue;
EGreen.Value := HSL.GValue; EGreen.Value := HSL.GValue;
EBlue.Value := HSL.BValue; EBlue.Value := HSL.BValue;
NewSwatch.Color := HSL.SelectedColor; NewSwatch.Color := HSL.SelectedColor;
end;
1:
begin
ERed.Value := HSL.HValue;
EGreen.Value := HSL.SValue;
EBlue.Value := HSL.LValue;
NewSwatch.Color := HSL.SelectedColor;
end;
end; end;
1:
begin
ERed.Value := HSL.HValue;
EGreen.Value := HSL.SValue;
EBlue.Value := HSL.LValue;
NewSwatch.Color := HSL.SelectedColor;
end;
end;
end; end;
procedure TfrmSelectColor.ERedChange(Sender: TObject); procedure TfrmSelectColor.ERedChange(Sender: TObject);
begin begin
if (ERed.Text <> '') and ERed.Focused then if (ERed.Text <> '') and ERed.Focused then
case ColorModel.ItemIndex of case ColorModel.ItemIndex of
0: 0:
begin begin
HSL.RValue := ERed.Value; HSL.RValue := ERed.Value;
NewSwatch.Color := RGB(ERed.Value, EGreen.Value, EBlue.Value); NewSwatch.Color := RGB(ERed.Value, EGreen.Value, EBlue.Value);
end; end;
1: 1:
begin begin
HSL.HValue := ERed.Value; HSL.HValue := ERed.Value;
NewSwatch.Color := HSLRangeToRGB(ERed.Value, EGreen.Value, EBlue.Value); NewSwatch.Color := HSLRangeToRGB(ERed.Value, EGreen.Value, EBlue.Value);
end; end;
end; end;
end; end;
procedure TfrmSelectColor.EGreenChange(Sender: TObject); procedure TfrmSelectColor.EGreenChange(Sender: TObject);
begin begin
if (EGreen.Text <> '') and EGreen.Focused then if (EGreen.Text <> '') and EGreen.Focused then
case ColorModel.ItemIndex of case ColorModel.ItemIndex of
0: 0:
begin begin
HSL.GValue := EGreen.Value; HSL.GValue := EGreen.Value;
NewSwatch.Color := RGB(ERed.Value, EGreen.Value, EBlue.Value); NewSwatch.Color := RGB(ERed.Value, EGreen.Value, EBlue.Value);
end; end;
1: 1:
begin begin
HSL.SValue := EGreen.Value; HSL.SValue := EGreen.Value;
NewSwatch.Color := HSLRangeToRGB(ERed.Value, EGreen.Value, EBlue.Value); NewSwatch.Color := HSLRangeToRGB(ERed.Value, EGreen.Value, EBlue.Value);
end; end;
end; end;
end; end;
procedure TfrmSelectColor.EBlueChange(Sender: TObject); procedure TfrmSelectColor.EBlueChange(Sender: TObject);
begin begin
if (EBlue.Text <> '') and EBlue.Focused then if (EBlue.Text <> '') and EBlue.Focused then
case ColorModel.ItemIndex of case ColorModel.ItemIndex of
0: 0:
begin begin
HSL.BValue := EBlue.Value; HSL.BValue := EBlue.Value;
NewSwatch.Color := RGB(ERed.Value, EGreen.Value, EBlue.Value); NewSwatch.Color := RGB(ERed.Value, EGreen.Value, EBlue.Value);
end; end;
1: 1:
begin begin
HSL.LValue := EBlue.Value; HSL.LValue := EBlue.Value;
NewSwatch.Color := HSLRangeToRGB(ERed.Value, EGreen.Value, EBlue.Value); NewSwatch.Color := HSLRangeToRGB(ERed.Value, EGreen.Value, EBlue.Value);
end; end;
end; end;
end; end;
procedure TfrmSelectColor.FormKeyDown(Sender: TObject; var Key: Word; procedure TfrmSelectColor.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
begin begin
case Key of case Key of
VK_RETURN: ModalResult := mrOK; VK_RETURN: ModalResult := mrOK;
VK_ESCAPE: ModalResult := mrCancel; VK_ESCAPE: ModalResult := mrCancel;
end; end;
end; end;
procedure TfrmSelectColor.HexaChange(Sender: TObject); procedure TfrmSelectColor.HexaChange(Sender: TObject);
begin begin
NewSwatch.Color := Hexa.SelectedColor; NewSwatch.Color := Hexa.SelectedColor;
end; end;
function TfrmSelectColor.GetHint(c: TColor): string; function TfrmSelectColor.GetHint(c: TColor): string;
begin begin
Result := Format('RGB(%u, %u, %u)'#13'Hex: %s', [GetRValue(c), GetGValue(c), GetBValue(c), ColorToHex(c)]); Result := Format('RGB(%u, %u, %u)'#13'Hex: %s', [GetRValue(c), GetGValue(c), GetBValue(c), ColorToHex(c)]);
end; end;
procedure TfrmSelectColor.NewSwatchColorChange(Sender: TObject); procedure TfrmSelectColor.NewSwatchColorChange(Sender: TObject);
begin begin
NewSwatch.Hint := GetHint(NewSwatch.Color); NewSwatch.Hint := GetHint(NewSwatch.Color);
end; end;
procedure TfrmSelectColor.OldSwatchColorChange(Sender: TObject); procedure TfrmSelectColor.OldSwatchColorChange(Sender: TObject);
begin begin
OldSwatch.Hint := GetHint(OldSwatch.Color); OldSwatch.Hint := GetHint(OldSwatch.Color);
SetAllToSel(OldSwatch.Color); SetAllToSel(OldSwatch.Color);
end; end;
procedure TfrmSelectColor.SetAllToSel(c: TColor); procedure TfrmSelectColor.SetAllToSel(c: TColor);
begin begin
case Pages.ActivePageIndex of case Pages.ActivePageIndex of
// Standard Page // Standard Page
0: Hexa.SelectedColor := c; 0: Hexa.SelectedColor := c;
// Custom Page // Custom Page
1: 1:
begin
HSL.SelectedColor := c;
case ColorModel.ItemIndex of
0:
begin begin
ERed.Value := GetRValue(c); HSL.SelectedColor := c;
EGreen.Value := GetGValue(c); case ColorModel.ItemIndex of
EBlue.Value := GetBValue(c); 0:
begin
ERed.Value := GetRValue(c);
EGreen.Value := GetGValue(c);
EBlue.Value := GetBValue(c);
end;
1:
begin
RGBtoHSLRange(c, h, s, l);
ERed.Value := h;
EGreen.Value := s;
EBlue.Value := l;
end;
end;
end; end;
1: end;
begin NewSwatch.Color := c;
RGBtoHSLRange(c, h, s, l);
ERed.Value := h;
EGreen.Value := s;
EBlue.Value := l;
end;
end;
end;
end;
NewSwatch.Color := c;
end; end;
procedure TfrmSelectColor.PagesChange(Sender: TObject); procedure TfrmSelectColor.PagesChange(Sender: TObject);
begin begin
SetAllToSel(NewSwatch.Color); SetAllToSel(NewSwatch.Color);
end; end;
procedure TfrmSelectColor.chkDefault2Click(Sender: TObject); procedure TfrmSelectColor.checkMouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin begin
chkDefault1.Checked := (Sender As TCheckBox).Checked; if (Sender = chkDefault1) or (Sender = chkDefault2) then begin
chkDefault2.Checked := (Sender As TCheckBox).Checked; chkDefault1.Checked := (Sender as TCheckBox).Checked;
chkDefault2.Checked := (Sender as TCheckBox).Checked;
chkNone1.Checked := False;
chkNone2.Checked := False;
newSwatch.Color := clDefault;
end
else if (Sender = chkNone1) or (Sender = chkNone2) then begin
chkNone1.Checked := (Sender as TCheckBox).Checked;
chkNone2.Checked := (Sender as TCheckBox).Checked;
chkDefault1.Checked := False;
chkDefault2.Checked := False;
newSwatch.Color := clNone;
end
else begin
if Standard.Visible then
newSwatch.Color := Hexa.Color
else
newSwatch.Color := HSL.Color;
end;
lblColor1.Enabled := not (Sender As TCheckBox).Checked; lblColor1.Enabled := not (Sender as TCheckBox).Checked;
bvlSpace1.Enabled := not (Sender As TCheckBox).Checked; bvlSpace1.Enabled := not (Sender as TCheckBox).Checked;
Hexa.Enabled := not (Sender As TCheckBox).Checked; Hexa.Enabled := not (Sender as TCheckBox).Checked;
lblColor2.Enabled := not (Sender As TCheckBox).Checked; lblColor2.Enabled := not (Sender as TCheckBox).Checked;
lblColorModel.Enabled := not (Sender As TCheckBox).Checked; lblColorModel.Enabled := not (Sender as TCheckBox).Checked;
LRed.Enabled := not (Sender As TCheckBox).Checked; LRed.Enabled := not (Sender as TCheckBox).Checked;
LGreen.Enabled := not (Sender As TCheckBox).Checked; LGreen.Enabled := not (Sender as TCheckBox).Checked;
LBlue.Enabled := not (Sender As TCheckBox).Checked; LBlue.Enabled := not (Sender as TCheckBox).Checked;
bvlSpace2.Enabled := not (Sender As TCheckBox).Checked; bvlSpace2.Enabled := not (Sender as TCheckBox).Checked;
HSL.Enabled := not (Sender As TCheckBox).Checked; HSL.Enabled := not (Sender as TCheckBox).Checked;
ColorModel.Enabled := not (Sender As TCheckBox).Checked; ColorModel.Enabled := not (Sender as TCheckBox).Checked;
ERed.Enabled := not (Sender As TCheckBox).Checked; ERed.Enabled := not (Sender as TCheckBox).Checked;
EGreen.Enabled := not (Sender As TCheckBox).Checked; EGreen.Enabled := not (Sender as TCheckBox).Checked;
EBlue.Enabled := not (Sender As TCheckBox).Checked; EBlue.Enabled := not (Sender as TCheckBox).Checked;
end; end;
end. end.

View File

@ -59,7 +59,7 @@ object frmSettings: TfrmSettings
Top = 0 Top = 0
Width = 353 Width = 353
Height = 260 Height = 260
ActivePage = jspShortcuts ActivePage = jspHighlighter
PropagateEnable = False PropagateEnable = False
Align = alClient Align = alClient
OnChange = jplSettingsChange OnChange = jplSettingsChange
@ -355,14 +355,14 @@ object frmSettings: TfrmSettings
Caption = 'Tools' Caption = 'Tools'
object bvlTools1: TBevel object bvlTools1: TBevel
Left = 4 Left = 4
Top = 66 Top = 68
Width = 347 Width = 347
Height = 3 Height = 3
Shape = bsTopLine Shape = bsTopLine
end end
object lblCodeFolding: TLabel object lblCodeFolding: TLabel
Left = 6 Left = 6
Top = 164 Top = 142
Width = 67 Width = 67
Height = 13 Height = 13
Caption = 'Code-Folding:' Caption = 'Code-Folding:'
@ -376,7 +376,7 @@ object frmSettings: TfrmSettings
end end
object lblAutoIndent: TLabel object lblAutoIndent: TLabel
Left = 194 Left = 194
Top = 164 Top = 142
Width = 63 Width = 63
Height = 13 Height = 13
Caption = 'Auto-Indent:' Caption = 'Auto-Indent:'
@ -428,7 +428,7 @@ object frmSettings: TfrmSettings
end end
object pnlCodeFolding: TPanel object pnlCodeFolding: TPanel
Left = 6 Left = 6
Top = 180 Top = 158
Width = 183 Width = 183
Height = 49 Height = 49
BevelOuter = bvLowered BevelOuter = bvLowered
@ -463,7 +463,7 @@ object frmSettings: TfrmSettings
Left = 6 Left = 6
Top = 92 Top = 92
Width = 343 Width = 343
Height = 67 Height = 43
BevelOuter = bvLowered BevelOuter = bvLowered
TabOrder = 6 TabOrder = 6
object imgCaretFore: TImage object imgCaretFore: TImage
@ -506,13 +506,6 @@ object frmSettings: TfrmSettings
Height = 13 Height = 13
Caption = 'Period:' Caption = 'Period:'
end end
object bvlCaret2: TBevel
Left = 1
Top = 42
Width = 340
Height = 3
Shape = bsTopLine
end
object cmdSelectCaretFore: TFlatButton object cmdSelectCaretFore: TFlatButton
Left = 28 Left = 28
Top = 20 Top = 20
@ -558,32 +551,6 @@ object frmSettings: TfrmSettings
TabOrder = 3 TabOrder = 3
OnChange = txtPeriodChange OnChange = txtPeriodChange
end end
object chkRestoreCaret: TFlatCheckBox
Left = 4
Top = 46
Width = 331
Height = 17
Caption = 'Do not restore caret if the document has more than xxxxxx lines'
TabOrder = 4
TabStop = True
OnClick = chkRestoreCaretClick
end
object txtLines: TFlatEdit
Left = 270
Top = 47
Width = 37
Height = 14
ColorFlat = clWhite
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -7
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 5
Text = '600'
OnChange = txtLinesChange
end
end end
object chkIndentGuides: TFlatCheckBox object chkIndentGuides: TFlatCheckBox
Left = 6 Left = 6
@ -596,7 +563,7 @@ object frmSettings: TfrmSettings
end end
object pnlAutoIndent: TPanel object pnlAutoIndent: TPanel
Left = 194 Left = 194
Top = 180 Top = 158
Width = 155 Width = 155
Height = 49 Height = 49
BevelOuter = bvLowered BevelOuter = bvLowered

View File

@ -105,9 +105,6 @@ type
cmdLoad: TFlatButton; cmdLoad: TFlatButton;
cmdUnload: TFlatButton; cmdUnload: TFlatButton;
cmdRemove: TFlatButton; cmdRemove: TFlatButton;
chkRestoreCaret: TFlatCheckBox;
txtLines: TFlatEdit;
bvlCaret2: TBevel;
optDontSave: TFlatRadioButton; optDontSave: TFlatRadioButton;
lblPAWN: TLabel; lblPAWN: TLabel;
pnlSMALLCompiler: TPanel; pnlSMALLCompiler: TPanel;
@ -186,11 +183,9 @@ type
cmdResetShortcuts: TFlatButton; cmdResetShortcuts: TFlatButton;
txtShortcut: TFlatEdit; txtShortcut: TFlatEdit;
procedure jplSettingsChange(Sender: TObject); procedure jplSettingsChange(Sender: TObject);
procedure txtLinesChange(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure chkRestoreCaretClick(Sender: TObject);
procedure txtFontSizeChange(Sender: TObject); procedure txtFontSizeChange(Sender: TObject);
procedure cboLanguageChange(Sender: TObject); procedure cboLanguageChange(Sender: TObject);
procedure chkUseDefaultFontClick(Sender: TObject); procedure chkUseDefaultFontClick(Sender: TObject);
@ -283,12 +278,6 @@ begin
txtCPPOutputChange(Sender); txtCPPOutputChange(Sender);
end; end;
procedure TfrmSettings.txtLinesChange(Sender: TObject);
begin
if not IsNumeric(txtLines.Text) then
txtLines.Text := '600';
end;
procedure TfrmSettings.FormCreate(Sender: TObject); procedure TfrmSettings.FormCreate(Sender: TObject);
begin begin
eConfig := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'config\Settings.ini'); eConfig := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'config\Settings.ini');
@ -322,17 +311,11 @@ end;
procedure TfrmSettings.FormShow(Sender: TObject); procedure TfrmSettings.FormShow(Sender: TObject);
var i: integer; var i: integer;
begin begin
txtLines.Enabled := chkRestoreCaret.Checked;
cboLanguage.OnChange(Self); cboLanguage.OnChange(Self);
for i := 0 to trvSettings.Items.Count -1 do for i := 0 to trvSettings.Items.Count -1 do
trvSettings.Items[i].Expand(True); trvSettings.Items[i].Expand(True);
end; end;
procedure TfrmSettings.chkRestoreCaretClick(Sender: TObject);
begin
txtLines.Enabled := chkRestoreCaret.Checked;
end;
procedure TfrmSettings.txtFontSizeChange(Sender: TObject); procedure TfrmSettings.txtFontSizeChange(Sender: TObject);
begin begin
if not IsNumeric(txtFontSize.Text) then begin if not IsNumeric(txtFontSize.Text) then begin
@ -476,6 +459,9 @@ begin
chkVisible.Checked := Visible; chkVisible.Checked := Visible;
txtFontSize.Text := IntToStr(TSciStyle(TSciLangItem(frmMain.sciEditor.LanguageManager.LanguageList.Items[cboLanguage.ItemIndex]).Styles.Items[lstStyles.ItemIndex]).FontSize); txtFontSize.Text := IntToStr(TSciStyle(TSciLangItem(frmMain.sciEditor.LanguageManager.LanguageList.Items[cboLanguage.ItemIndex]).Styles.Items[lstStyles.ItemIndex]).FontSize);
Foreground := ForeColor;
Background := BackColor;
PaintForeground(ForeColor); PaintForeground(ForeColor);
PaintBackground(BackColor); PaintBackground(BackColor);
end; end;

View File

@ -215,7 +215,7 @@ begin
Handled := True; Handled := True;
end; end;
if not frmMain.Focused then exit; if GetForegroundWindow <> frmMain.Handle then exit;
// stop IRC Paster if escape is pressed // stop IRC Paster if escape is pressed
if (Msg.CharCode = VK_ESCAPE) then begin if (Msg.CharCode = VK_ESCAPE) then begin
@ -257,6 +257,8 @@ begin
Handled := True; Handled := True;
if (eShortcut = Shortcut(Ord('K'), [ssCtrl])) then if (eShortcut = Shortcut(Ord('K'), [ssCtrl])) then
Handled := True; Handled := True;
if (eShortcut = Shortcut(Ord('S'), [ssCtrl])) then
Handled := True;
if (eShortcut = Shortcut(Ord('B'), [ssCtrl, ssShift])) then if (eShortcut = Shortcut(Ord('B'), [ssCtrl, ssShift])) then
Handled := True; Handled := True;
if (eShortcut = Shortcut(Ord('C'), [ssCtrl, ssShift])) then if (eShortcut = Shortcut(Ord('C'), [ssCtrl, ssShift])) then