You've already forked lazarus-ccr
defaultElementForm, defaultAttributeForm : Type Library Editor Support.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4232 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
object fModuleEdit: TfModuleEdit
|
object fModuleEdit: TfModuleEdit
|
||||||
Left = 750
|
Left = 750
|
||||||
Height = 300
|
Height = 326
|
||||||
Top = 93
|
Top = 93
|
||||||
Width = 400
|
Width = 400
|
||||||
HorzScrollBar.Page = 399
|
HorzScrollBar.Page = 399
|
||||||
@ -8,14 +8,14 @@ object fModuleEdit: TfModuleEdit
|
|||||||
ActiveControl = Button1
|
ActiveControl = Button1
|
||||||
BorderStyle = bsSizeToolWin
|
BorderStyle = bsSizeToolWin
|
||||||
Caption = 'Module properties'
|
Caption = 'Module properties'
|
||||||
ClientHeight = 300
|
ClientHeight = 326
|
||||||
ClientWidth = 400
|
ClientWidth = 400
|
||||||
Position = poDesktopCenter
|
Position = poDesktopCenter
|
||||||
LCLVersion = '1.2.2.0'
|
LCLVersion = '1.4.1.0'
|
||||||
object Panel1: TPanel
|
object Panel1: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 50
|
Height = 50
|
||||||
Top = 250
|
Top = 276
|
||||||
Width = 400
|
Width = 400
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
ClientHeight = 50
|
ClientHeight = 50
|
||||||
@ -45,7 +45,7 @@ object fModuleEdit: TfModuleEdit
|
|||||||
end
|
end
|
||||||
object PageControl1: TPageControl
|
object PageControl1: TPageControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 250
|
Height = 276
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 400
|
Width = 400
|
||||||
ActivePage = TabSheet1
|
ActivePage = TabSheet1
|
||||||
@ -54,47 +54,93 @@ object fModuleEdit: TfModuleEdit
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object TabSheet1: TTabSheet
|
object TabSheet1: TTabSheet
|
||||||
Caption = 'Module'
|
Caption = 'Module'
|
||||||
ClientHeight = 222
|
ClientHeight = 250
|
||||||
ClientWidth = 392
|
ClientWidth = 392
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
Left = 20
|
Left = 20
|
||||||
Height = 15
|
Height = 13
|
||||||
Top = 39
|
Top = 24
|
||||||
Width = 32
|
Width = 27
|
||||||
Caption = 'Name'
|
Caption = 'Name'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object Label2: TLabel
|
object Label2: TLabel
|
||||||
Left = 20
|
Left = 20
|
||||||
Height = 15
|
Height = 13
|
||||||
Top = 127
|
Top = 77
|
||||||
Width = 62
|
Width = 55
|
||||||
Caption = 'Namespace'
|
Caption = 'Namespace'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object edtName: TEdit
|
object edtName: TEdit
|
||||||
Left = 20
|
Left = 20
|
||||||
Height = 23
|
Height = 21
|
||||||
Top = 55
|
Top = 40
|
||||||
Width = 344
|
Width = 356
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Text = 'edtName'
|
Text = 'edtName'
|
||||||
end
|
end
|
||||||
object edtNamespace: TEdit
|
object edtNamespace: TEdit
|
||||||
Left = 20
|
Left = 20
|
||||||
Height = 23
|
Height = 21
|
||||||
Top = 143
|
Top = 93
|
||||||
Width = 344
|
Width = 356
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Text = 'edtNamespace'
|
Text = 'edtNamespace'
|
||||||
end
|
end
|
||||||
|
object edtDefaultElementForm: TRadioGroup
|
||||||
|
Left = 20
|
||||||
|
Height = 108
|
||||||
|
Top = 132
|
||||||
|
Width = 170
|
||||||
|
AutoFill = True
|
||||||
|
Caption = ' Default Element Form '
|
||||||
|
ChildSizing.LeftRightSpacing = 6
|
||||||
|
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||||
|
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||||
|
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||||
|
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||||
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
|
ChildSizing.ControlsPerLine = 1
|
||||||
|
ClientHeight = 90
|
||||||
|
ClientWidth = 166
|
||||||
|
Items.Strings = (
|
||||||
|
'<unspecified>'
|
||||||
|
'qualified'
|
||||||
|
'unqualified'
|
||||||
|
)
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object edtDefaultAttributeForm: TRadioGroup
|
||||||
|
Left = 206
|
||||||
|
Height = 108
|
||||||
|
Top = 132
|
||||||
|
Width = 170
|
||||||
|
AutoFill = True
|
||||||
|
Caption = ' Default Attribute Form '
|
||||||
|
ChildSizing.LeftRightSpacing = 6
|
||||||
|
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||||
|
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||||
|
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||||
|
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||||
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
|
ChildSizing.ControlsPerLine = 1
|
||||||
|
ClientHeight = 90
|
||||||
|
ClientWidth = 166
|
||||||
|
Items.Strings = (
|
||||||
|
'<unspecified>'
|
||||||
|
'qualified'
|
||||||
|
'unqualified'
|
||||||
|
)
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object AL: TActionList
|
object AL: TActionList
|
||||||
left = 115
|
left = 136
|
||||||
top = 126
|
top = 32
|
||||||
object actOK: TAction
|
object actOK: TAction
|
||||||
Caption = 'OK'
|
Caption = 'OK'
|
||||||
OnExecute = actOKExecute
|
OnExecute = actOKExecute
|
||||||
|
@ -19,7 +19,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||||
ComCtrls, StdCtrls, ActnList, Buttons,
|
ComCtrls, StdCtrls, ActnList, Buttons,
|
||||||
pastree, pascal_parser_intf,
|
pastree, pascal_parser_intf, xsd_consts,
|
||||||
edit_helper;
|
edit_helper;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -37,6 +37,8 @@ type
|
|||||||
Label2: TLabel;
|
Label2: TLabel;
|
||||||
PageControl1: TPageControl;
|
PageControl1: TPageControl;
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
|
edtDefaultElementForm: TRadioGroup;
|
||||||
|
edtDefaultAttributeForm: TRadioGroup;
|
||||||
TabSheet1: TTabSheet;
|
TabSheet1: TTabSheet;
|
||||||
procedure actOKExecute(Sender: TObject);
|
procedure actOKExecute(Sender: TObject);
|
||||||
procedure actOKUpdate(Sender: TObject);
|
procedure actOKUpdate(Sender: TObject);
|
||||||
@ -73,16 +75,42 @@ begin
|
|||||||
TAction(Sender).Enabled := not ( IsStrEmpty(edtName.Text) or IsStrEmpty(edtNamespace.Text));
|
TAction(Sender).Enabled := not ( IsStrEmpty(edtName.Text) or IsStrEmpty(edtNamespace.Text));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function FormStringToIndex(const AStr : string) : Integer;
|
||||||
|
begin
|
||||||
|
if (AStr = s_qualified) then
|
||||||
|
Result := 1
|
||||||
|
else if (AStr = s_unqualified) then
|
||||||
|
Result := 2
|
||||||
|
else
|
||||||
|
Result := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfModuleEdit.LoadFromObject();
|
procedure TfModuleEdit.LoadFromObject();
|
||||||
|
var
|
||||||
|
s : string;
|
||||||
begin
|
begin
|
||||||
edtName.Text := FSymbolTable.GetExternalName(FObject);
|
edtName.Text := FSymbolTable.GetExternalName(FObject);
|
||||||
edtNamespace.Text := FSymbolTable.GetExternalName(FObject);
|
edtNamespace.Text := FSymbolTable.GetExternalName(FObject);
|
||||||
|
s := FSymbolTable.Properties.GetValue(FObject,s_elementFormDefault);
|
||||||
|
edtDefaultElementForm.ItemIndex := FormStringToIndex(s);
|
||||||
|
s := FSymbolTable.Properties.GetValue(FObject,s_attributeFormDefault);
|
||||||
|
edtDefaultAttributeForm.ItemIndex := FormStringToIndex(s);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfModuleEdit.SaveToObject();
|
procedure TfModuleEdit.SaveToObject();
|
||||||
|
var
|
||||||
|
s : string;
|
||||||
begin
|
begin
|
||||||
FObject.Name := ExtractIdentifier(edtName.Text);
|
FObject.Name := ExtractIdentifier(edtName.Text);
|
||||||
FSymbolTable.RegisterExternalAlias(FObject,Trim(edtNamespace.Text));
|
FSymbolTable.RegisterExternalAlias(FObject,Trim(edtNamespace.Text));
|
||||||
|
s := '';
|
||||||
|
if (edtDefaultElementForm.ItemIndex > 0) then
|
||||||
|
s := edtDefaultElementForm.Items[edtDefaultElementForm.ItemIndex];
|
||||||
|
FSymbolTable.Properties.SetValue(FObject,s_elementFormDefault,s);
|
||||||
|
s := '';
|
||||||
|
if (edtDefaultAttributeForm.ItemIndex > 0) then
|
||||||
|
s := edtDefaultAttributeForm.Items[edtDefaultAttributeForm.ItemIndex];
|
||||||
|
FSymbolTable.Properties.SetValue(FObject,s_attributeFormDefault,s);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TfModuleEdit.UpdateObject(
|
function TfModuleEdit.UpdateObject(
|
||||||
|
Reference in New Issue
Block a user