Simba/ReadOnly: Some additional changes.

Still doesn't work fully. Doesn't focus on tab creation.
This commit is contained in:
Merlijn Wajer 2011-02-23 12:22:03 +01:00
parent da4c5cc68c
commit 0bc29c6b26
2 changed files with 9 additions and 8 deletions

View File

@ -657,7 +657,7 @@ procedure TScriptFrame.SetReadOnly(ReadOnly: Boolean);
begin begin
SynEdit.ReadOnly := ReadOnly; SynEdit.ReadOnly := ReadOnly;
SynEdit.Enabled := not ReadOnly; SynEdit.Enabled := not ReadOnly;
if not ReadOnly then if not ReadOnly and SynEdit.CanFocus then
SynEdit.SetFocus; SynEdit.SetFocus;
end; end;

View File

@ -410,7 +410,7 @@ type
procedure SetScriptState(const State: TScriptState); procedure SetScriptState(const State: TScriptState);
function CreateSetting(const Key, Value : string) : string; function CreateSetting(const Key, Value : string) : string;
procedure SetSetting(const key,Value : string; save : boolean = false); procedure SetSetting(const key,Value : string; save : boolean = false);
function SettingExtists(const key : string) : boolean; function SettingExists(const key : string) : boolean;
procedure FontUpdate; procedure FontUpdate;
public public
DebugStream: String; DebugStream: String;
@ -1193,7 +1193,8 @@ begin
if Self.Showing then if Self.Showing then
if Tab.TabSheet.TabIndex = Self.PageControl1.TabIndex then if Tab.TabSheet.TabIndex = Self.PageControl1.TabIndex then
if CurrScript.SynEdit.CanFocus then if CurrScript.SynEdit.CanFocus then
CurrScript.SynEdit.SetFocus; CurrScript.SynEdit.SetFocus; // XXX: This is never called
StopCodeCompletion;//To set the highlighting back to normal; StopCodeCompletion;//To set the highlighting back to normal;
frmFunctionList.LoadScriptTree(CurrScript.SynEdit.Text); frmFunctionList.LoadScriptTree(CurrScript.SynEdit.Text);
with CurrScript.SynEdit do with CurrScript.SynEdit do
@ -1297,7 +1298,7 @@ begin
else else
// if str = 'normal' then // if str = 'normal' then
Self.WindowState := wsNormal; Self.WindowState := wsNormal;
if SettingExtists('LastConfig/MainForm/RecentFiles/Count') then if SettingExists('LastConfig/MainForm/RecentFiles/Count') then
begin; begin;
ii := StrToIntDef(LoadSettingDef('LastConfig/MainForm/RecentFiles/Count','-1'),-1); ii := StrToIntDef(LoadSettingDef('LastConfig/MainForm/RecentFiles/Count','-1'),-1);
for i := 0 to ii do for i := 0 to ii do
@ -1388,7 +1389,7 @@ var
if (number < 0) or (number >= extCount) then if (number < 0) or (number >= extCount) then
exit; exit;
path := 'Extensions/Extension' + inttostr(number); path := 'Extensions/Extension' + inttostr(number);
if SettingExtists(Path) = false then if SettingExists(Path) = false then
exit; exit;
ExtPath := LoadSettingDef(Path + '/Path',''); ExtPath := LoadSettingDef(Path + '/Path','');
if ExtPath = '' then if ExtPath = '' then
@ -1633,7 +1634,7 @@ end;
procedure TSimbaForm.ActionCloseTabExecute(Sender: TObject); procedure TSimbaForm.ActionCloseTabExecute(Sender: TObject);
begin begin
if(PageControl1.PageCount > 1)then if(PageControl1.PageCount > 1) then
Self.DeleteTab(PageControl1.TabIndex,false) Self.DeleteTab(PageControl1.TabIndex,false)
else else
Self.ClearScript; //DeleteTab would take care of this already, but yeah, it's neater this way. Self.ClearScript; //DeleteTab would take care of this already, but yeah, it's neater this way.
@ -2093,7 +2094,7 @@ end;
procedure TSimbaForm.MenuItemHandbookClick(Sender: TObject); procedure TSimbaForm.MenuItemHandbookClick(Sender: TObject);
begin begin
OpenURL('http://wizzup.org/simbadoc/'); OpenURL('http://docs.wizzup.org/simba/');
end; end;
procedure TSimbaForm.MenuItemColourHistoryClick(Sender: TObject); procedure TSimbaForm.MenuItemColourHistoryClick(Sender: TObject);
@ -2900,7 +2901,7 @@ begin
SettingsForm.Settings.SaveToXML(SimbaSettingsFile); SettingsForm.Settings.SaveToXML(SimbaSettingsFile);
end; end;
function TSimbaForm.SettingExtists(const key: string): boolean; function TSimbaForm.SettingExists(const key: string): boolean;
begin begin
result :=SettingsForm.Settings.KeyExists(key); result :=SettingsForm.Settings.KeyExists(key);
end; end;