Skip to content

Commit

Permalink
Images-lister control added
Browse files Browse the repository at this point in the history
  • Loading branch information
tvannini committed Jul 19, 2018
1 parent 572908e commit c859661
Show file tree
Hide file tree
Showing 9 changed files with 383 additions and 29 deletions.
39 changes: 30 additions & 9 deletions area_form.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ object f_areaform: Tf_areaform
Expand = NoExpand
end
object o2separator1: To2separator
Left = 112
Left = 104
Top = 96
Width = 33
Height = 73
Visibile = 0
Expand = NoExpand
end
object o2document1: To2document
Left = 392
Left = 376
Top = 144
Width = 113
Height = 65
Expand Down Expand Up @@ -133,7 +133,7 @@ object f_areaform: Tf_areaform
Expand = NoExpand
end
object o2htmlarea1: To2htmlarea
Left = 392
Left = 376
Top = 24
Width = 113
Height = 113
Expand Down Expand Up @@ -216,7 +216,7 @@ object f_areaform: Tf_areaform
Expand = NoExpand
end
object DBNavigator1: TDBNavigator
Left = 152
Left = 144
Top = 200
Width = 220
Height = 25
Expand All @@ -235,7 +235,7 @@ object f_areaform: Tf_areaform
Expand = NoExpand
end
object o2multipage1: To2multipage
Left = 152
Left = 144
Top = 232
Width = 225
Height = 145
Expand Down Expand Up @@ -287,7 +287,7 @@ object f_areaform: Tf_areaform
Expand = NoExpand
end
object o2dbnavigator1: To2dbnavigator
Left = 152
Left = 144
Top = 176
Width = 225
Height = 17
Expand All @@ -312,7 +312,7 @@ object f_areaform: Tf_areaform
Expand = NoExpand
end
object o2table1: To2table
Left = 152
Left = 144
Top = 24
Width = 225
Height = 145
Expand All @@ -328,14 +328,29 @@ object f_areaform: Tf_areaform
Expand = NoExpand
end
object o2tree1: To2tree
Left = 392
Top = 232
Left = 496
Top = 24
Width = 100
Height = 150
Caption = 'o2tree1'
Color = 15528176
TabOrder = 0
Visibile = 0
Nodes = 0
Expand = NoExpand
end
object o2imglist1: To2imglist
Left = 376
Top = 224
Width = 120
Height = 120
BevelInner = bvLowered
BevelOuter = bvNone
Caption = 'o2imglist1'
Color = 15527152
TabOrder = 0
Visibile = 0
Items = 0
Expand = NoExpand
end
end
Expand Down Expand Up @@ -394,6 +409,9 @@ object f_areaform: Tf_areaform
'View'
'Field'
'Nodes|Tree nodes'
'Items|Items'
'ItemWidth|Item width'
'ItemHeight|Item height'
'Activation|Selection'
'Visibile|Visible'
'Abilitato|Enabled'
Expand All @@ -403,6 +421,7 @@ object f_areaform: Tf_areaform
'ImageFile|Image file'
'Scelte|Items'
'Azione|Action'
'Delete|Delete action'
'Submitonchange|Submit on change'
'Rifagente|Operator ref'
'Messaggio|Confirm message'
Expand Down Expand Up @@ -482,10 +501,12 @@ object f_areaform: Tf_areaform
'o2Label'
'Text'
'Nodes'
'Items'
'Visibile'
'Abilitato'
'Picture'
'Azione'
'Delete'
'Scelte'
'Rifagente'
'Riftask'
Expand Down
74 changes: 71 additions & 3 deletions area_form.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ interface
o2groupbox, o2checkbox, o2button, o2agente, o2textarea, Menus,
o2table, DBCtrls, Math, ActnList, XPStyleActnCtrls, ActnMan,
o2ListBox, ComCtrls, o2multipage,
o2file, jclstrings, o2htmlarea, o2tree, o2document, jpeg, jvgif, ExtDlgs,
o2Map, DsnSub8, o2dbnavigator, o2navigator,DBClient,DB;
o2file, jclstrings, o2htmlarea, o2tree, o2imglist, o2document, jpeg, jvgif,
ExtDlgs, o2Map, DsnSub8, o2dbnavigator, o2navigator,DBClient,DB;

type
Tf_areaform = class(TForm)
Expand Down Expand Up @@ -81,6 +81,7 @@ Tf_areaform = class(TForm)
Exit1: TMenuItem;
sepmenuExit: TMenuItem;
o2tree1: To2tree;
o2imglist1: To2imglist;

procedure FormShow(Sender: TObject);
procedure DsnInspector1BtnClick(Sender: TObject; Targets: TSelectedComponents;
Expand Down Expand Up @@ -147,6 +148,7 @@ Tf_areaform = class(TForm)
tmp_multipage: To2multipage;
tmp_htmlarea: To2htmlarea;
tmp_tree: To2tree;
tmp_imglist: To2imglist;
tmp_document: To2document;
tmp_map: To2Map;
larghezza_form, altezza_form: integer;
Expand Down Expand Up @@ -501,6 +503,7 @@ procedure Tf_areaform.DsnInspector1BtnClick(Sender: TObject;
(PropName = 'Submitonchange') or
(PropName = 'Html') or
(PropName = 'Nodes') or
(PropName = 'Items') or
(PropName = 'Path') or
(PropName = 'Save_as') or
(PropName = 'TooltipExp') or
Expand Down Expand Up @@ -935,7 +938,9 @@ procedure Tf_areaform.DsnInspector1BtnClick(Sender: TObject;
end;
end;
// ____________________________________ Submit on change and other actions ___
if (PropName = 'Azione') or (Pos('Action', PropName) > 0) then
if (PropName = 'Azione') or
(Pos('Action', PropName) > 0) or
(PropName = 'Delete') then
begin
Value:= f_work.call_scelta_azione(Value);
end;
Expand Down Expand Up @@ -1627,6 +1632,21 @@ procedure Tf_areaform.nuovo_controllo(Sender: TObject; Component: TComponent);
end;


if Component.ClassType.ClassName = 'To2imglist' then
begin
tmp_imglist := findcomponent(Component.Name) as To2imglist;
tmp_imglist.Parentname := tmp_imglist.Parent.Name;
if controllo.Height = 0 then
begin
controllo.Height := 150
end;
if controllo.Width = 0 then
begin
controllo.Width := 150
end;
end;


if Component.ClassType.ClassName = 'To2document' then
begin
tmp_document := findcomponent(Component.Name) as To2document;
Expand Down Expand Up @@ -1675,6 +1695,7 @@ procedure Tf_areaform.salva_controlliExecute(Sender: TObject; controllo: TWinCon
control_multipage: To2multipage;
control_htmlarea: To2htmlarea;
control_tree: To2tree;
control_imglist: To2imglist;
control_document: To2document;
control_map: To2Map;
controllo_corrente: TControl;
Expand Down Expand Up @@ -2228,6 +2249,28 @@ procedure Tf_areaform.salva_controlliExecute(Sender: TObject; controllo: TWinCon
extra1 := IntToStr(control_tree.Nodes);
scelte := control_tree.TreeActAsString(control_tree.Activation);
end
// _____________________________________________________ IMAGES-LISTER ___
else if controllo.Controls[i].ClassName = 'To2imglist' then
begin
control_imglist := controllo.Controls[i] as To2imglist;
tipocontrollo := 'imglist';
visibile := control_imglist.Visibile;
vocecss := control_imglist.Vocecss;
azione := control_imglist.Azione;
taborder := control_imglist.TabOrder;
Expand := ExpandAsString(control_imglist.Expand);
parentinfo := control_imglist.Parentinfo;
if control_imglist.Parent.ClassName = 'To2table' then
begin
parentinfo := calcola_parent_info(control_imglist, parentinfo);
end;

extra1 := IntToStr(control_imglist.Items);
extra2 := control_imglist.Delete;
exp1 := control_imglist.ItemWidth;
exp2 := control_imglist.ItemHeight;

end
// __________________________________________________________ DOCUMENT ___
else if controllo.Controls[i].ClassName = 'To2document' then
begin
Expand Down Expand Up @@ -2348,6 +2391,7 @@ procedure Tf_areaform.carica_controlliExecute(Sender: TObject);
control_multipage : To2multipage;
control_htmlarea : To2htmlarea;
control_tree : To2tree;
control_imglist : To2imglist;
control_document : To2document;
control_map : To2Map;
begin
Expand Down Expand Up @@ -2948,6 +2992,30 @@ procedure Tf_areaform.carica_controlliExecute(Sender: TObject);
control_tree.Expand :=
StringAsExpand(dm_form.t_controlliformExpand.Value);
end
// _______________________________________________ Control IMAGES-LISTER ___
else if dm_form.t_controlliformtipo.Value = 'imglist' then
begin
control_imglist := To2imglist.Create(self);
control_imglist.Parent :=
FindComponent(dm_form.t_controlliformparent.Value)
as TWinControl;
control_imglist.Name := dm_form.t_controlliformnomecontrollo.Value;
control_imglist.Top := dm_form.t_controlliformtop.Value;
control_imglist.Left := dm_form.t_controlliformleft.Value;
control_imglist.Width := dm_form.t_controlliformlarghezza.Value;
control_imglist.Height := dm_form.t_controlliformaltezza.Value;
control_imglist.Visibile := dm_form.t_controlliformvisibile.Value;
control_imglist.Vocecss := dm_form.t_controlliformvocecss.Value;
control_imglist.Items := dm_form.t_controlliformextra1.AsInteger;
control_imglist.Azione := dm_form.t_controlliformazione.Value;
control_imglist.Delete := dm_form.t_controlliformextra2.Value;
control_imglist.ItemWidth := dm_form.t_controlliformexp1.AsInteger;
control_imglist.ItemHeight := dm_form.t_controlliformexp2.AsInteger;
control_imglist.Parentinfo := dm_form.t_controlliformparent_info.Value;
control_imglist.TabOrder := dm_form.t_controlliformtaborder.Value;
control_imglist.Expand :=
StringAsExpand(dm_form.t_controlliformExpand.Value);
end
// ____________________________________________________ Control DOCUMENT ___
else if dm_form.t_controlliformtipo.Value = 'document' then
begin
Expand Down
3 changes: 2 additions & 1 deletion controlli.dpk
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ contains
o2Map in 'o2Map.pas',
o2dbnavigator in 'o2dbnavigator.pas',
o2tree in 'o2tree.pas',
DsnUnit in 'dsn22a\ComponentSource\DsnUnit.pas';
DsnUnit in 'dsn22a\ComponentSource\DsnUnit.pas',
o2imglist in 'o2imglist.pas';

end.
40 changes: 40 additions & 0 deletions export.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,46 @@ procedure Tf_export.prg_exportExecute(Sender: TObject; newnomeprg: string);
Memo3.Add(buffer);
end;
end
// _____________________________________ IMAGES-LISTER control ___
else if t_controlliformtipo.Value = 'imglist' then
begin
// ___________________________________________ Delete action ___
buffer := chr(9) + chr(9) + '$ctrl_' + nomecontrollo +
'->delete("' +
t_controlliformextra2.Value + '");';
Memo3.Add(buffer);
// ________________________________________ Items expression ___
if (t_controlliformextra1.Value <> '') and
(t_controlliformextra1.Value <> '0') then
begin
buffer := chr(9) + chr(9) + '$ctrl_' + nomecontrollo +
'->items(' + nomeprg + '_exp_' +
t_controlliformextra1.Value + '());';
Memo3.Add(buffer);
end;
// _____________________________________________ Items width ___
if (t_controlliformexp1.Value <> 0) then
begin
buffer := chr(9) + chr(9) + '$ctrl_' + nomecontrollo +
'->items_w(' + IntToStr(t_controlliformexp1.Value) +
');';
Memo3.Add(buffer);
end;
// ____________________________________________ Items height ___
if (t_controlliformexp2.Value <> 0) then
begin
buffer := chr(9) + chr(9) + '$ctrl_' + nomecontrollo +
'->items_h(' + IntToStr(t_controlliformexp2.Value) +
');';
Memo3.Add(buffer);
end;
if css <> '' then
begin
buffer := chr(9) + chr(9) + '$ctrl_' + nomecontrollo +
'->css(' + css + ');';
Memo3.Add(buffer);
end;
end
// __________________________________________ Document control ___
else if t_controlliformtipo.Value = 'document' then
begin
Expand Down
Loading

0 comments on commit c859661

Please sign in to comment.