mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 13:10:53 +02:00
added status icons to nodes, expand/collapse menu items
git-svn-id: trunk@7656 -
This commit is contained in:
parent
a3a98f7ca6
commit
fc0770006d
10
.gitattributes
vendored
10
.gitattributes
vendored
@ -446,9 +446,6 @@ designer/sizecompsdlg.pp svneol=native#text/pascal
|
|||||||
designer/taborderdlg.lfm svneol=native#text/plain
|
designer/taborderdlg.lfm svneol=native#text/plain
|
||||||
designer/taborderdlg.lrs svneol=native#text/pascal
|
designer/taborderdlg.lrs svneol=native#text/pascal
|
||||||
designer/taborderdlg.pas svneol=native#text/pascal
|
designer/taborderdlg.pas svneol=native#text/pascal
|
||||||
doceditor/add.xpm -text svneol=native#image/x-xpixmap
|
|
||||||
doceditor/delete.xpm -text svneol=native#image/x-xpixmap
|
|
||||||
doceditor/edit.xpm -text svneol=native#image/x-xpixmap
|
|
||||||
doceditor/eleditor.pp svneol=native#text/pascal
|
doceditor/eleditor.pp svneol=native#text/pascal
|
||||||
doceditor/eleditor.xml svneol=native#text/xml
|
doceditor/eleditor.xml svneol=native#text/xml
|
||||||
doceditor/fmmakeskel.lfm svneol=native#text/plain
|
doceditor/fmmakeskel.lfm svneol=native#text/plain
|
||||||
@ -487,6 +484,13 @@ doceditor/frmtable.lfm svneol=native#text/plain
|
|||||||
doceditor/frmtable.lrs svneol=native#text/pascal
|
doceditor/frmtable.lrs svneol=native#text/pascal
|
||||||
doceditor/frmtable.pp svneol=native#text/pascal
|
doceditor/frmtable.pp svneol=native#text/pascal
|
||||||
doceditor/icons.lrs svneol=native#text/pascal
|
doceditor/icons.lrs svneol=native#text/pascal
|
||||||
|
doceditor/images/add.xpm -text svneol=native#image/x-xpixmap
|
||||||
|
doceditor/images/delete.xpm -text svneol=native#image/x-xpixmap
|
||||||
|
doceditor/images/edit.xpm -text svneol=native#image/x-xpixmap
|
||||||
|
doceditor/images/node_edit.xpm -text svneol=native#image/x-xpixmap
|
||||||
|
doceditor/images/node_finished.xpm -text svneol=native#image/x-xpixmap
|
||||||
|
doceditor/images/node_modified.xpm -text svneol=native#image/x-xpixmap
|
||||||
|
doceditor/images/node_new.xpm -text svneol=native#image/x-xpixmap
|
||||||
doceditor/lazde.lpi svneol=native#text/plain
|
doceditor/lazde.lpi svneol=native#text/plain
|
||||||
doceditor/lazde.lpr svneol=native#text/pascal
|
doceditor/lazde.lpr svneol=native#text/pascal
|
||||||
doceditor/lazdemsg.pp svneol=native#text/pascal
|
doceditor/lazdemsg.pp svneol=native#text/pascal
|
||||||
|
@ -40,16 +40,22 @@ Type
|
|||||||
|
|
||||||
TCustomElementEditor = Class(TPanel)
|
TCustomElementEditor = Class(TPanel)
|
||||||
private
|
private
|
||||||
|
FChangedEvent: TNotifyEvent;
|
||||||
Felement : TDomElement;
|
Felement : TDomElement;
|
||||||
FGetElementList: TGetElementListEvent;
|
FGetElementList: TGetElementListEvent;
|
||||||
FSavedNode,
|
FSavedNode,
|
||||||
FModified : Boolean;
|
FModified : Boolean;
|
||||||
FTargetFileName: string;
|
FTargetFileName: string;
|
||||||
FGetInitialDir: TGetInitialDirEvent;
|
FGetInitialDir: TGetInitialDirEvent;
|
||||||
|
FChangeEvent: TNotifyEvent;
|
||||||
|
FOnChangeCount: Integer;
|
||||||
|
procedure SetModified(const AValue: Boolean);
|
||||||
Protected
|
Protected
|
||||||
Function GetCurrentSelection : String; virtual; abstract;
|
Function GetCurrentSelection : String; virtual; abstract;
|
||||||
Procedure SetElement (Value : TDomElement); virtual;
|
Procedure SetElement (Value : TDomElement); virtual;
|
||||||
Function GetInitialDir: String;
|
Function GetInitialDir: String;
|
||||||
|
procedure LockOnChange;
|
||||||
|
procedure UnLockOnChange;
|
||||||
Public
|
Public
|
||||||
Procedure Refresh; virtual; abstract;
|
Procedure Refresh; virtual; abstract;
|
||||||
Function TestSave(S : String) : Boolean; virtual; abstract;
|
Function TestSave(S : String) : Boolean; virtual; abstract;
|
||||||
@ -63,11 +69,12 @@ Type
|
|||||||
Procedure InsertTable(Cols,Rows : Integer; UseHeader : Boolean); virtual; abstract;
|
Procedure InsertTable(Cols,Rows : Integer; UseHeader : Boolean); virtual; abstract;
|
||||||
Property Element : TDomElement Read FElement Write SetElement;
|
Property Element : TDomElement Read FElement Write SetElement;
|
||||||
Property CurrentSelection : String Read GetCurrentSelection;
|
Property CurrentSelection : String Read GetCurrentSelection;
|
||||||
Property Modified : Boolean Read FModified Write FModified;
|
Property Modified : Boolean Read FModified Write SetModified;
|
||||||
Property SavedNode : Boolean Read FSavedNode Write FSavedNode;
|
Property SavedNode : Boolean Read FSavedNode Write FSavedNode;
|
||||||
Property TargetFileName: String read FTargetFileName write FTargetFileName;
|
Property TargetFileName: String read FTargetFileName write FTargetFileName;
|
||||||
Property OnGetElementList : TGetElementListEvent Read FGetElementList Write FGetElementList;
|
Property OnGetElementList : TGetElementListEvent Read FGetElementList Write FGetElementList;
|
||||||
Property OnGetInitialDir: TGetInitialDirEvent read FGetInitialdir write FGetInitialDir;
|
Property OnGetInitialDir: TGetInitialDirEvent read FGetInitialdir write FGetInitialDir;
|
||||||
|
Property OnChange: TNotifyEvent read FChangeEvent write FChangeEvent;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TElementEditor }
|
{ TElementEditor }
|
||||||
@ -133,6 +140,13 @@ uses frmexample,frmLink;
|
|||||||
|
|
||||||
{ TCustomElementEditor }
|
{ TCustomElementEditor }
|
||||||
|
|
||||||
|
procedure TCustomElementEditor.SetModified(const AValue: Boolean);
|
||||||
|
begin
|
||||||
|
FModified := AValue;
|
||||||
|
if (FOnChangeCount=0) and FModified and Assigned(FChangeEvent) then
|
||||||
|
FChangeEvent(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomElementEditor.SetElement(Value: TDomElement);
|
procedure TCustomElementEditor.SetElement(Value: TDomElement);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -146,6 +160,16 @@ begin
|
|||||||
result := FGetInitialdir();
|
result := FGetInitialdir();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomElementEditor.LockOnChange;
|
||||||
|
begin
|
||||||
|
FOnChangeCount := 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomElementEditor.UnLockOnChange;
|
||||||
|
begin
|
||||||
|
FOnChangeCount := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
TElementEditor
|
TElementEditor
|
||||||
---------------------------------------------------------------------}
|
---------------------------------------------------------------------}
|
||||||
@ -158,6 +182,7 @@ Var
|
|||||||
L : Tlabel;
|
L : Tlabel;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
LockOnChange;
|
||||||
Inherited;
|
Inherited;
|
||||||
FExampleNodes:=TList.create;
|
FExampleNodes:=TList.create;
|
||||||
ILElements:=TImageList.Create(Self);
|
ILElements:=TImageList.Create(Self);
|
||||||
@ -450,6 +475,7 @@ begin
|
|||||||
else
|
else
|
||||||
FLabel.Text:=SNoElement;
|
FLabel.Text:=SNoElement;
|
||||||
S:=TStringStream.Create('');
|
S:=TStringStream.Create('');
|
||||||
|
LockOnChange;
|
||||||
Try
|
Try
|
||||||
FShortEntry.Text:=RemoveLineFeeds(NodeToString(FShortNode));
|
FShortEntry.Text:=RemoveLineFeeds(NodeToString(FShortNode));
|
||||||
FDescrMemo.Text:=NodeToString(FDescrNode);
|
FDescrMemo.Text:=NodeToString(FDescrNode);
|
||||||
@ -471,6 +497,7 @@ begin
|
|||||||
FModified:=False;
|
FModified:=False;
|
||||||
Finally
|
Finally
|
||||||
S.Free;
|
S.Free;
|
||||||
|
UnLockOnChange;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -603,7 +630,7 @@ begin
|
|||||||
S:=Format('<%s>%s</%s>',[TagName,S,TagName]);
|
S:=Format('<%s>%s</%s>',[TagName,S,TagName]);
|
||||||
Seltext:=S;
|
Seltext:=S;
|
||||||
SelLength:=Length(S);
|
SelLength:=Length(S);
|
||||||
FModified:=True;
|
Modified:=True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -711,7 +738,7 @@ Procedure TElementEditor.OnTextModified(Sender : TObject);
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if Sender=nil then ;
|
if Sender=nil then ;
|
||||||
FModified:=True;
|
Modified:=True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TElementEditor.DoAddExample(Sender: TObject);
|
procedure TElementEditor.DoAddExample(Sender: TObject);
|
||||||
|
@ -13,6 +13,7 @@ object MainForm: TMainForm
|
|||||||
Height = 544
|
Height = 544
|
||||||
Width = 602
|
Width = 602
|
||||||
object TBMain: TToolBar
|
object TBMain: TToolBar
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
ButtonHeight = 28
|
ButtonHeight = 28
|
||||||
ButtonWidth = 28
|
ButtonWidth = 28
|
||||||
Caption = 'TBMain'
|
Caption = 'TBMain'
|
||||||
@ -187,6 +188,7 @@ object MainForm: TMainForm
|
|||||||
end
|
end
|
||||||
object PCFiles: TPageControl
|
object PCFiles: TPageControl
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Left = 5
|
Left = 5
|
||||||
Height = 468
|
Height = 468
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -37,3 +37,47 @@ LazarusResources.Add('edit','XPM',[
|
|||||||
+'..#aaaaaa#.......",'#10'".......#aaaaa#........",'#10'"........#####.......'
|
+'..#aaaaaa#.......",'#10'".......#aaaaa#........",'#10'"........#####.......'
|
||||||
+'..",'#10'"......................"};'#10
|
+'..",'#10'"......................"};'#10
|
||||||
]);
|
]);
|
||||||
|
LazarusResources.Add('node_edit','XPM',[
|
||||||
|
'/* XPM */'#10'static char * node_edit_xpm[] = {'#10'"13 14 13 1",'#10'" '#9
|
||||||
|
+'c None",'#10'".'#9'c #FFFFFF",'#10'"+'#9'c #909290",'#10'"@'#9'c #848684",'
|
||||||
|
+#10'"#'#9'c #FFFF00",'#10'"$'#9'c #C6C7C6",'#10'"%'#9'c #EE0808",'#10'"&'#9
|
||||||
|
+'c #000000",'#10'"*'#9'c #888B88",'#10'"='#9'c #FDFEFD",'#10'"-'#9'c #8B8E8B'
|
||||||
|
+'",'#10'";'#9'c #FDFDFD",'#10'">'#9'c #FEFEFE",'#10'".............",'#10'".+'
|
||||||
|
+'@@@@@@@....",'#10'".+#.#.#.$@...",'#10'".+.#.#.#$.@..",'#10'".+#.%.#.&&&&."'
|
||||||
|
+','#10'".*.#%%.%%#$&.",'#10'"=-#.%%%%%.$&.",'#10'";+.#%#%#%#$&.",'#10'";+#.%'
|
||||||
|
+'.%.%.$&.",'#10'";+.#%#.#%#$&.",'#10'">+#.#.#.#.$&.",'#10'";+$$$$$$$$$&.",'
|
||||||
|
+#10'">&&&&&&&&&&&.",'#10'">............"};'#10
|
||||||
|
]);
|
||||||
|
LazarusResources.Add('node_finished','XPM',[
|
||||||
|
'/* XPM */'#10'static char * node_finished_xpm[] = {'#10'"13 14 13 1",'#10'" '
|
||||||
|
+#9'c None",'#10'".'#9'c #FFFFFF",'#10'"+'#9'c #909290",'#10'"@'#9'c #848684"'
|
||||||
|
+','#10'"#'#9'c #FFFF00",'#10'"$'#9'c #C6C7C6",'#10'"%'#9'c #000000",'#10'"&'
|
||||||
|
+#9'c #888B88",'#10'"*'#9'c #086F1E",'#10'"='#9'c #FDFEFD",'#10'"-'#9'c #8B8E'
|
||||||
|
+'8B",'#10'";'#9'c #FDFDFD",'#10'">'#9'c #FEFEFE",'#10'".............",'#10'"'
|
||||||
|
+'.+@@@@@@@....",'#10'".+#.#.#.$@...",'#10'".+.#.#.#$.@..",'#10'".+#.#.#.%%%%'
|
||||||
|
+'.",'#10'".&.#.#.**#$%.",'#10'"=-#*#.#**.$%.",'#10'";+.**#**.#$%.",'#10'";+#'
|
||||||
|
+'**.**#.$%.",'#10'";+.#***#.#$%.",'#10'">+#.#**.#.$%.",'#10'";+$$$$$$$$$%.",'
|
||||||
|
+#10'">%%%%%%%%%%%.",'#10'">............"};'#10
|
||||||
|
]);
|
||||||
|
LazarusResources.Add('node_modified','XPM',[
|
||||||
|
'/* XPM */'#10'static char * node_modified_xpm[] = {'#10'"13 14 13 1",'#10'" '
|
||||||
|
+#9'c None",'#10'".'#9'c #FFFFFF",'#10'"+'#9'c #909290",'#10'"@'#9'c #848684"'
|
||||||
|
+','#10'"#'#9'c #FFFF00",'#10'"$'#9'c #C6C7C6",'#10'"%'#9'c #000000",'#10'"&'
|
||||||
|
+#9'c #888B88",'#10'"*'#9'c #2A00FD",'#10'"='#9'c #FDFEFD",'#10'"-'#9'c #8B8E'
|
||||||
|
+'8B",'#10'";'#9'c #FDFDFD",'#10'">'#9'c #FEFEFE",'#10'".............",'#10'"'
|
||||||
|
+'.+@@@@@@@....",'#10'".+#.#.#.$@...",'#10'".+.#.#.#$.@..",'#10'".+#.#.#.%%%%'
|
||||||
|
+'.",'#10'".&.******#$%.",'#10'"=-#******.$%.",'#10'";+.*.**#*#$%.",'#10'";+#'
|
||||||
|
+'.#**.#.$%.",'#10'";+.#.**#.#$%.",'#10'">+#.****#.$%.",'#10'";+$$$$$$$$$%.",'
|
||||||
|
+#10'">%%%%%%%%%%%.",'#10'">............"};'#10
|
||||||
|
]);
|
||||||
|
LazarusResources.Add('node_new','XPM',[
|
||||||
|
'/* XPM */'#10'static char * node_new_xpm[] = {'#10'"13 14 12 1",'#10'" '#9'c'
|
||||||
|
+' None",'#10'".'#9'c #FFFFFF",'#10'"+'#9'c #909290",'#10'"@'#9'c #848684",'
|
||||||
|
+#10'"#'#9'c #FFFF00",'#10'"$'#9'c #C6C7C6",'#10'"%'#9'c #000000",'#10'"&'#9
|
||||||
|
+'c #888B88",'#10'"*'#9'c #FDFEFD",'#10'"='#9'c #8B8E8B",'#10'"-'#9'c #FDFDFD'
|
||||||
|
+'",'#10'";'#9'c #FEFEFE",'#10'".............",'#10'".+@@@@@@@....",'#10'".+#'
|
||||||
|
+'.#.#.$@...",'#10'".+.#.#.#$.@..",'#10'".+#.#.#.%%%%.",'#10'".&.#.#.#.#$%.",'
|
||||||
|
+#10'"*=#.#.#.#.$%.",'#10'"-+.#.#.#.#$%.",'#10'"-+#.#.#.#.$%.",'#10'"-+.#.#.#'
|
||||||
|
+'.#$%.",'#10'";+#.#.#.#.$%.",'#10'"-+$$$$$$$$$%.",'#10'";%%%%%%%%%%%.",'#10
|
||||||
|
+'";............"};'#10
|
||||||
|
]);
|
||||||
|
30
doceditor/images/node_edit.xpm
Normal file
30
doceditor/images/node_edit.xpm
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char * node_edit_xpm[] = {
|
||||||
|
"13 14 13 1",
|
||||||
|
" c None",
|
||||||
|
". c #FFFFFF",
|
||||||
|
"+ c #909290",
|
||||||
|
"@ c #848684",
|
||||||
|
"# c #FFFF00",
|
||||||
|
"$ c #C6C7C6",
|
||||||
|
"% c #EE0808",
|
||||||
|
"& c #000000",
|
||||||
|
"* c #888B88",
|
||||||
|
"= c #FDFEFD",
|
||||||
|
"- c #8B8E8B",
|
||||||
|
"; c #FDFDFD",
|
||||||
|
"> c #FEFEFE",
|
||||||
|
".............",
|
||||||
|
".+@@@@@@@....",
|
||||||
|
".+#.#.#.$@...",
|
||||||
|
".+.#.#.#$.@..",
|
||||||
|
".+#.%.#.&&&&.",
|
||||||
|
".*.#%%.%%#$&.",
|
||||||
|
"=-#.%%%%%.$&.",
|
||||||
|
";+.#%#%#%#$&.",
|
||||||
|
";+#.%.%.%.$&.",
|
||||||
|
";+.#%#.#%#$&.",
|
||||||
|
">+#.#.#.#.$&.",
|
||||||
|
";+$$$$$$$$$&.",
|
||||||
|
">&&&&&&&&&&&.",
|
||||||
|
">............"};
|
30
doceditor/images/node_finished.xpm
Normal file
30
doceditor/images/node_finished.xpm
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char * node_finished_xpm[] = {
|
||||||
|
"13 14 13 1",
|
||||||
|
" c None",
|
||||||
|
". c #FFFFFF",
|
||||||
|
"+ c #909290",
|
||||||
|
"@ c #848684",
|
||||||
|
"# c #FFFF00",
|
||||||
|
"$ c #C6C7C6",
|
||||||
|
"% c #000000",
|
||||||
|
"& c #888B88",
|
||||||
|
"* c #086F1E",
|
||||||
|
"= c #FDFEFD",
|
||||||
|
"- c #8B8E8B",
|
||||||
|
"; c #FDFDFD",
|
||||||
|
"> c #FEFEFE",
|
||||||
|
".............",
|
||||||
|
".+@@@@@@@....",
|
||||||
|
".+#.#.#.$@...",
|
||||||
|
".+.#.#.#$.@..",
|
||||||
|
".+#.#.#.%%%%.",
|
||||||
|
".&.#.#.**#$%.",
|
||||||
|
"=-#*#.#**.$%.",
|
||||||
|
";+.**#**.#$%.",
|
||||||
|
";+#**.**#.$%.",
|
||||||
|
";+.#***#.#$%.",
|
||||||
|
">+#.#**.#.$%.",
|
||||||
|
";+$$$$$$$$$%.",
|
||||||
|
">%%%%%%%%%%%.",
|
||||||
|
">............"};
|
30
doceditor/images/node_modified.xpm
Normal file
30
doceditor/images/node_modified.xpm
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char * node_modified_xpm[] = {
|
||||||
|
"13 14 13 1",
|
||||||
|
" c None",
|
||||||
|
". c #FFFFFF",
|
||||||
|
"+ c #909290",
|
||||||
|
"@ c #848684",
|
||||||
|
"# c #FFFF00",
|
||||||
|
"$ c #C6C7C6",
|
||||||
|
"% c #000000",
|
||||||
|
"& c #888B88",
|
||||||
|
"* c #2A00FD",
|
||||||
|
"= c #FDFEFD",
|
||||||
|
"- c #8B8E8B",
|
||||||
|
"; c #FDFDFD",
|
||||||
|
"> c #FEFEFE",
|
||||||
|
".............",
|
||||||
|
".+@@@@@@@....",
|
||||||
|
".+#.#.#.$@...",
|
||||||
|
".+.#.#.#$.@..",
|
||||||
|
".+#.#.#.%%%%.",
|
||||||
|
".&.******#$%.",
|
||||||
|
"=-#******.$%.",
|
||||||
|
";+.*.**#*#$%.",
|
||||||
|
";+#.#**.#.$%.",
|
||||||
|
";+.#.**#.#$%.",
|
||||||
|
">+#.****#.$%.",
|
||||||
|
";+$$$$$$$$$%.",
|
||||||
|
">%%%%%%%%%%%.",
|
||||||
|
">............"};
|
29
doceditor/images/node_new.xpm
Normal file
29
doceditor/images/node_new.xpm
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char * node_new_xpm[] = {
|
||||||
|
"13 14 12 1",
|
||||||
|
" c None",
|
||||||
|
". c #FFFFFF",
|
||||||
|
"+ c #909290",
|
||||||
|
"@ c #848684",
|
||||||
|
"# c #FFFF00",
|
||||||
|
"$ c #C6C7C6",
|
||||||
|
"% c #000000",
|
||||||
|
"& c #888B88",
|
||||||
|
"* c #FDFEFD",
|
||||||
|
"= c #8B8E8B",
|
||||||
|
"- c #FDFDFD",
|
||||||
|
"; c #FEFEFE",
|
||||||
|
".............",
|
||||||
|
".+@@@@@@@....",
|
||||||
|
".+#.#.#.$@...",
|
||||||
|
".+.#.#.#$.@..",
|
||||||
|
".+#.#.#.%%%%.",
|
||||||
|
".&.#.#.#.#$%.",
|
||||||
|
"*=#.#.#.#.$%.",
|
||||||
|
"-+.#.#.#.#$%.",
|
||||||
|
"-+#.#.#.#.$%.",
|
||||||
|
"-+.#.#.#.#$%.",
|
||||||
|
";+#.#.#.#.$%.",
|
||||||
|
"-+$$$$$$$$$%.",
|
||||||
|
";%%%%%%%%%%%.",
|
||||||
|
";............"};
|
@ -80,7 +80,6 @@ ResourceString
|
|||||||
'See http://www.freepascal.org/';
|
'See http://www.freepascal.org/';
|
||||||
SFileStructure = 'Documentation structure';
|
SFileStructure = 'Documentation structure';
|
||||||
SModuleElements = 'Elements for selected node';
|
SModuleElements = 'Elements for selected node';
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
Menu strings
|
Menu strings
|
||||||
---------------------------------------------------------------------}
|
---------------------------------------------------------------------}
|
||||||
@ -115,6 +114,8 @@ ResourceString
|
|||||||
|
|
||||||
SMenuRename = 'Rename';
|
SMenuRename = 'Rename';
|
||||||
SMenuDelete = 'Delete';
|
SMenuDelete = 'Delete';
|
||||||
|
SMenuExpandAll = 'Expand All';
|
||||||
|
SMenuCollapseAll = 'Collapse All';
|
||||||
|
|
||||||
SMenuExtra = 'Extra';
|
SMenuExtra = 'Extra';
|
||||||
SMenuExtraoptions = 'Options';
|
SMenuExtraoptions = 'Options';
|
||||||
|
@ -299,6 +299,14 @@ lazdemsg.smenurename='Rename'
|
|||||||
lazdemsg.smenudelete='Delete'
|
lazdemsg.smenudelete='Delete'
|
||||||
|
|
||||||
|
|
||||||
|
# hash value = 138578252
|
||||||
|
lazdemsg.smenuexpandall='Expand All'
|
||||||
|
|
||||||
|
|
||||||
|
# hash value = 53573292
|
||||||
|
lazdemsg.smenucollapseall='Collapse All'
|
||||||
|
|
||||||
|
|
||||||
# hash value = 5045121
|
# hash value = 5045121
|
||||||
lazdemsg.smenuextra='Extra'
|
lazdemsg.smenuextra='Extra'
|
||||||
|
|
||||||
|
@ -39,6 +39,12 @@ Var
|
|||||||
CmdMakeSkel : String;
|
CmdMakeSkel : String;
|
||||||
cmdFPDoc : String;
|
cmdFPDoc : String;
|
||||||
|
|
||||||
|
Const
|
||||||
|
ImgIndxNew = 0;
|
||||||
|
ImgIndxEdited = 1;
|
||||||
|
ImgIndxModified = 2;
|
||||||
|
imgIndxFinished = 3;
|
||||||
|
|
||||||
Procedure LoadOptions;
|
Procedure LoadOptions;
|
||||||
Procedure SaveOptions;
|
Procedure SaveOptions;
|
||||||
Function GetOptionFileName : String;
|
Function GetOptionFileName : String;
|
||||||
|
@ -83,6 +83,7 @@ Type
|
|||||||
Function GetModified : Boolean;
|
Function GetModified : Boolean;
|
||||||
Function MakeBackup(FN : String) : Boolean;
|
Function MakeBackup(FN : String) : Boolean;
|
||||||
Procedure DisplayDocument;
|
Procedure DisplayDocument;
|
||||||
|
Procedure ElementChanged(Sender: TObject);
|
||||||
Public
|
Public
|
||||||
Constructor Create(AOwner : TComponent); override;
|
Constructor Create(AOwner : TComponent); override;
|
||||||
Function FirstPackage : TDomElement;
|
Function FirstPackage : TDomElement;
|
||||||
@ -139,6 +140,7 @@ begin
|
|||||||
Felement.Align:=AlClient;
|
Felement.Align:=AlClient;
|
||||||
FElement.OnGetElementList:=@GetELementList;
|
FElement.OnGetElementList:=@GetELementList;
|
||||||
FElement.OnGetInitialDir:=@GetInitialDir;
|
FElement.OnGetInitialDir:=@GetInitialDir;
|
||||||
|
FElement.OnChange:=@ElementChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -229,6 +231,11 @@ begin
|
|||||||
FPackages.DescriptionNode:=FDocument.DocumentElement;
|
FPackages.DescriptionNode:=FDocument.DocumentElement;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TEditorPage.ElementChanged(Sender: TObject);
|
||||||
|
begin
|
||||||
|
TPackageEditor(FPackages).UpdateSelectedNodeStatus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure TEditorPage.ElementSelected(Node : TDomElement) ;
|
Procedure TEditorPage.ElementSelected(Node : TDomElement) ;
|
||||||
|
|
||||||
|
@ -86,7 +86,10 @@ Type
|
|||||||
FMRenameMenu,
|
FMRenameMenu,
|
||||||
FMDeleteMenu,
|
FMDeleteMenu,
|
||||||
FERenameMenu,
|
FERenameMenu,
|
||||||
|
FECollapseAllMenu,
|
||||||
|
FEExpandAllMenu,
|
||||||
FEDeleteMenu : TMenuItem;
|
FEDeleteMenu : TMenuItem;
|
||||||
|
FImagelist : TImageList;
|
||||||
// Callbacks for visual controls.
|
// Callbacks for visual controls.
|
||||||
Procedure ModuleChange(Sender: TObject; Node: TTreeNode);
|
Procedure ModuleChange(Sender: TObject; Node: TTreeNode);
|
||||||
Procedure ModuleChanging(Sender: TObject; Node: TTreeNode;
|
Procedure ModuleChanging(Sender: TObject; Node: TTreeNode;
|
||||||
@ -98,6 +101,8 @@ Type
|
|||||||
Procedure TreeClick(Sender: TObject);
|
Procedure TreeClick(Sender: TObject);
|
||||||
Procedure MenuRenameClick(Sender : TObject);
|
Procedure MenuRenameClick(Sender : TObject);
|
||||||
Procedure MenuDeleteClick(Sender : TObject);
|
Procedure MenuDeleteClick(Sender : TObject);
|
||||||
|
Procedure MenuCollapseAllClick(Sender: TObject);
|
||||||
|
procedure MenuExpandAllClick(Sender: TObject);
|
||||||
// Internal node methods.
|
// Internal node methods.
|
||||||
Procedure DeleteNode(Msg : String; N : TTreeNode; E : TDomElement);
|
Procedure DeleteNode(Msg : String; N : TTreeNode; E : TDomElement);
|
||||||
Procedure DeleteElementNode(N : TTreeNode);
|
Procedure DeleteElementNode(N : TTreeNode);
|
||||||
@ -126,6 +131,9 @@ Type
|
|||||||
Procedure SetCurrentModuleNode(N : TTreeNode);
|
Procedure SetCurrentModuleNode(N : TTreeNode);
|
||||||
Procedure SetCurrentPackageNode(N : TTreeNode);
|
Procedure SetCurrentPackageNode(N : TTreeNode);
|
||||||
Procedure SetCurrentTopicNode(T : TTreeNode);
|
Procedure SetCurrentTopicNode(T : TTreeNode);
|
||||||
|
// Other methods
|
||||||
|
procedure UpdateNodeImage(N: TTreeNode);
|
||||||
|
procedure SetNodeImage(N: TTreeNode; Index: Integer);
|
||||||
Protected
|
Protected
|
||||||
Procedure SetCurrentModule(Value : TDomElement); override;
|
Procedure SetCurrentModule(Value : TDomElement); override;
|
||||||
Procedure SetCurrentPackage(Value : TDomElement); override;
|
Procedure SetCurrentPackage(Value : TDomElement); override;
|
||||||
@ -144,6 +152,7 @@ Type
|
|||||||
Procedure RenameModule(M : TDomElement); override;
|
Procedure RenameModule(M : TDomElement); override;
|
||||||
Procedure RenameElement(E : TDomElement); override;
|
Procedure RenameElement(E : TDomElement); override;
|
||||||
Procedure RenameTopic(T : TDomElement); override;
|
Procedure RenameTopic(T : TDomElement); override;
|
||||||
|
procedure UpdateSelectedNodeStatus;
|
||||||
Property ModuleTree : TTreeView Read FModuleTree;
|
Property ModuleTree : TTreeView Read FModuleTree;
|
||||||
Property ElementTree : TTreeView Read FElementTree;
|
Property ElementTree : TTreeView Read FElementTree;
|
||||||
end;
|
end;
|
||||||
@ -151,7 +160,7 @@ Type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses frmNewNode;
|
uses frmNewNode, graphics;
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
Auxiliary routines
|
Auxiliary routines
|
||||||
@ -246,7 +255,9 @@ end;
|
|||||||
---------------------------------------------------------------------}
|
---------------------------------------------------------------------}
|
||||||
|
|
||||||
Constructor TPackageEditor.Create(AOwner : TComponent);
|
Constructor TPackageEditor.Create(AOwner : TComponent);
|
||||||
|
var
|
||||||
|
TmpPanel: TPanel;
|
||||||
|
|
||||||
Function NewMenuItem(ACaption : String; AOnClick : TNotifyEvent) : TMenuItem;
|
Function NewMenuItem(ACaption : String; AOnClick : TNotifyEvent) : TMenuItem;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -257,6 +268,12 @@ Constructor TPackageEditor.Create(AOwner : TComponent);
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Inherited;
|
Inherited;
|
||||||
|
FImageList := TImageList.Create(Self);
|
||||||
|
Fimagelist.AddFromLazarusResource('node_new'); // ImgIndxNew
|
||||||
|
Fimagelist.AddFromLazarusResource('node_edit'); // ImgIndxEdited
|
||||||
|
Fimagelist.AddFromLazarusResource('node_modified'); // ImgIndxModified
|
||||||
|
Fimagelist.AddFromLazarusResource('node_finished'); // ImgIndxFinished
|
||||||
|
|
||||||
FLModules:=Tlabel.Create(Self);
|
FLModules:=Tlabel.Create(Self);
|
||||||
With FLModules do
|
With FLModules do
|
||||||
begin
|
begin
|
||||||
@ -271,6 +288,7 @@ begin
|
|||||||
Parent:=Self;
|
Parent:=Self;
|
||||||
Align:=AlTop;
|
Align:=AlTop;
|
||||||
Height:=150;
|
Height:=150;
|
||||||
|
Images:=FImageList;
|
||||||
OnChange:=@ModuleChange;
|
OnChange:=@ModuleChange;
|
||||||
OnChanging:=@ModuleChanging;
|
OnChanging:=@ModuleChanging;
|
||||||
// Till the above two get fixed, use this
|
// Till the above two get fixed, use this
|
||||||
@ -301,6 +319,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
Parent:=FpElements;
|
Parent:=FpElements;
|
||||||
Align:=AlClient;
|
Align:=AlClient;
|
||||||
|
Images:=FImageList;
|
||||||
OnChange:=@ElementChange;
|
OnChange:=@ElementChange;
|
||||||
OnChanging:=@ElementChanging;
|
OnChanging:=@ElementChanging;
|
||||||
// Till the above two get fixed, use this:
|
// Till the above two get fixed, use this:
|
||||||
@ -309,8 +328,13 @@ begin
|
|||||||
PEMenu:=TPopupMenu.Create(Self);
|
PEMenu:=TPopupMenu.Create(Self);
|
||||||
FERenameMenu:=NewMenuItem(SMenuRename,@MenuRenameClick);
|
FERenameMenu:=NewMenuItem(SMenuRename,@MenuRenameClick);
|
||||||
FEDeleteMenu:=NewMenuItem(SMenuDelete,@MenuDeleteClick);
|
FEDeleteMenu:=NewMenuItem(SMenuDelete,@MenuDeleteClick);
|
||||||
|
FEExpandAllMenu:=NewMenuItem(SMenuExpandAll,@MenuExpandAllClick);
|
||||||
|
FECollapseAllMenu:=NewMenuItem(SMenuCollapseAll,@MenuCollapseAllClick);
|
||||||
PEMenu.Items.Add(FERenameMenu);
|
PEMenu.Items.Add(FERenameMenu);
|
||||||
PEMenu.Items.Add(FEDeleteMenu);
|
PEMenu.Items.Add(FEDeleteMenu);
|
||||||
|
PEMenu.Items.Add(NewMenuItem('-',nil));
|
||||||
|
PEMEnu.Items.Add(FEExpandAllMenu);
|
||||||
|
PEMenu.Items.Add(FECollapseAllMenu);
|
||||||
FElementTree.PopupMenu:=PEMenu;
|
FElementTree.PopupMenu:=PEMenu;
|
||||||
PMMenu:=TPopupMenu.Create(Self);
|
PMMenu:=TPopupMenu.Create(Self);
|
||||||
FMRenameMenu:=NewMenuItem(SMenuRename,@MenuRenameClick);
|
FMRenameMenu:=NewMenuItem(SMenuRename,@MenuRenameClick);
|
||||||
@ -493,6 +517,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPackageEditor.MenuCollapseAllClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Node: TTreeNode;
|
||||||
|
begin
|
||||||
|
ElementTree.FullCollapse;
|
||||||
|
Node := ElementTree.Items.GetFirstNode;
|
||||||
|
if Node<>nil then
|
||||||
|
Node.Expand(False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPackageEditor.MenuExpandAllClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ElementTree.FullExpand;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure TPackageEditor.SetModuleNode(N : TTreeNode);
|
Procedure TPackageEditor.SetModuleNode(N : TTreeNode);
|
||||||
|
|
||||||
@ -662,6 +701,59 @@ begin
|
|||||||
RenameNode(SRenameTopic,N);
|
RenameNode(SRenameTopic,N);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure DebugElement(Element: TDomElement);
|
||||||
|
var
|
||||||
|
Level: integer;
|
||||||
|
const
|
||||||
|
NType:Array[0..12] of String[30] =
|
||||||
|
(
|
||||||
|
'0:UNKNOWN',
|
||||||
|
'1:ELEMENT_NODE',
|
||||||
|
'2:ATTRIBUTE_NODE',
|
||||||
|
'3:TEXT_NODE',
|
||||||
|
'4:CDATA_SECTION_NODE',
|
||||||
|
'5:ENTITY_REFERENCE_NODE',
|
||||||
|
'6:ENTITY_NODE',
|
||||||
|
'7:PROCESSING_INSTRUCTION_NODE',
|
||||||
|
'8:COMMENT_NODE',
|
||||||
|
'9:DOCUMENT_NODE',
|
||||||
|
'10:DOCUMENT_TYPE_NODE',
|
||||||
|
'11:DOCUMENT_FRAGMENT_NODE',
|
||||||
|
'12:NOTATION_NODE'
|
||||||
|
);
|
||||||
|
function GetLevelSpc: String;
|
||||||
|
begin
|
||||||
|
SetLength(Result, Level*2);
|
||||||
|
FillChar(Result[1], Level*2, ' ');
|
||||||
|
end;
|
||||||
|
procedure DebugNodes(Node: TDomNode);
|
||||||
|
begin
|
||||||
|
Node := Node.FirstChild;
|
||||||
|
while node<>nil do begin
|
||||||
|
WriteLn(GetLevelSpc, 'Node=',Node.NodeName,' Type=',NType[Node.NodeType],' Value=',Node.NodeValue);
|
||||||
|
if (node.NodeType = ELEMENT_NODE) then begin
|
||||||
|
Inc(Level);
|
||||||
|
DebugNodes(Node);
|
||||||
|
Dec(Level);
|
||||||
|
end;
|
||||||
|
Node := Node.NextSibling;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
begin
|
||||||
|
if assigned(Element) then begin
|
||||||
|
WriteLn('Element: ', Element['name'],': ');
|
||||||
|
level := 1;
|
||||||
|
DebugNodes(Element);
|
||||||
|
end else
|
||||||
|
WriteLn('Element <nil>');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TPackageEditor.UpdateSelectedNodeStatus;
|
||||||
|
begin
|
||||||
|
if ElementTree.Selected<>nil then
|
||||||
|
SetNodeImage(ElementTree.Selected, ImgIndxModified);
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure TPackageEditor.RenameElement(E : TDomElement);
|
Procedure TPackageEditor.RenameElement(E : TDomElement);
|
||||||
|
|
||||||
@ -697,6 +789,7 @@ begin
|
|||||||
FModuleNode:=FElementTree.Items.Add(Nil,Module['name']);
|
FModuleNode:=FElementTree.Items.Add(Nil,Module['name']);
|
||||||
S:=TStringList.Create;
|
S:=TStringList.Create;
|
||||||
Try
|
Try
|
||||||
|
// get sorted list of elements
|
||||||
Node:=Module.FirstChild;
|
Node:=Module.FirstChild;
|
||||||
While Assigned(Node) do
|
While Assigned(Node) do
|
||||||
begin
|
begin
|
||||||
@ -705,12 +798,15 @@ begin
|
|||||||
Node:=Node.NextSibling;
|
Node:=Node.NextSibling;
|
||||||
end;
|
end;
|
||||||
S.Sorted:=True;
|
S.Sorted:=True;
|
||||||
|
// root node
|
||||||
TNode:=FModuleNode;
|
TNode:=FModuleNode;
|
||||||
|
// process list of elements, create levels
|
||||||
For I:=0 to S.Count-1 do
|
For I:=0 to S.Count-1 do
|
||||||
begin
|
begin
|
||||||
PNode:=Nil;
|
PNode:=Nil;
|
||||||
SNode:=TNode;
|
SNode:=TNode;
|
||||||
N:=S[i];
|
N:=S[i];
|
||||||
|
// look for a tentative new parents
|
||||||
While (SNode<>FModuleNode) and (PNode=Nil) do
|
While (SNode<>FModuleNode) and (PNode=Nil) do
|
||||||
begin
|
begin
|
||||||
PN:=TDomElement(SNode.Data)['name']+'.';
|
PN:=TDomElement(SNode.Data)['name']+'.';
|
||||||
@ -725,6 +821,7 @@ begin
|
|||||||
System.Delete(N,1,L);
|
System.Delete(N,1,L);
|
||||||
TNode:=FElementTree.Items.AddChild(PNode,N);
|
TNode:=FElementTree.Items.AddChild(PNode,N);
|
||||||
TNode.Data:=S.Objects[i];
|
TNode.Data:=S.Objects[i];
|
||||||
|
UpdateNodeImage(TNode);
|
||||||
end;
|
end;
|
||||||
Finally
|
Finally
|
||||||
S.Free;
|
S.Free;
|
||||||
@ -962,6 +1059,58 @@ begin
|
|||||||
CurrentElement:=Nil;
|
CurrentElement:=Nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPackageEditor.UpdateNodeImage(N: TTreeNode);
|
||||||
|
var
|
||||||
|
ImgIndex: Integer;
|
||||||
|
Node: TDomNode;
|
||||||
|
Element: TDomElement;
|
||||||
|
begin
|
||||||
|
if assigned(N) then begin
|
||||||
|
|
||||||
|
Element := TDomElement(N.Data);
|
||||||
|
//DebugElement(Element);
|
||||||
|
if not Assigned(Element) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
// get image index accoding of element edit state
|
||||||
|
ImgIndex := ImgIndxNew;
|
||||||
|
node := Element.FirstChild;
|
||||||
|
while Assigned(node) do begin
|
||||||
|
if (node.NodeType=ELEMENT_NODE) and node.HasChildNodes then begin
|
||||||
|
if
|
||||||
|
(
|
||||||
|
(node.NodeName = 'short') or
|
||||||
|
(node.NodeName = 'descr') or
|
||||||
|
(node.NodeName = 'sealso') or
|
||||||
|
(node.NodeName = 'example') or
|
||||||
|
(node.NodeName = 'errors')
|
||||||
|
) then begin
|
||||||
|
ImgIndex := ImgIndxModified;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Node := Node.NextSibling;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// assign index to node and propagate status to parent
|
||||||
|
SetNodeImage(N, ImgIndex);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPackageEditor.SetNodeImage(N: TTreeNode; Index: Integer);
|
||||||
|
begin
|
||||||
|
N.ImageIndex := Index;
|
||||||
|
N.SelectedIndex := Index;
|
||||||
|
if Index>ImgIndxEdited then
|
||||||
|
while assigned(N.Parent) do begin
|
||||||
|
N := N.Parent;
|
||||||
|
if N.ImageIndex < ImgIndxEdited then begin
|
||||||
|
N.ImageIndex := ImgIndxEdited;
|
||||||
|
N.SelectedIndex := ImgIndxEdited;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure TPackageEditor.SetCurrentElement(E : TDomElement);
|
Procedure TPackageEditor.SetCurrentElement(E : TDomElement);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user