diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
commit | 864081102a5f252415f41950b3039a896b4ae9c5 (patch) | |
tree | c6b764651e9dd1f8f53b98eab05f16ba4a492a79 /plugins/Watrack/kolframe/frm_designer.inc | |
parent | db5149b48346c417e18add5702a9dfe7f6e28dd0 (diff) |
Awkwars's plugins - welcome to our trunk
git-svn-id: http://svn.miranda-ng.org/main/trunk@1822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Watrack/kolframe/frm_designer.inc')
-rw-r--r-- | plugins/Watrack/kolframe/frm_designer.inc | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/plugins/Watrack/kolframe/frm_designer.inc b/plugins/Watrack/kolframe/frm_designer.inc new file mode 100644 index 0000000000..f12c01f05d --- /dev/null +++ b/plugins/Watrack/kolframe/frm_designer.inc @@ -0,0 +1,164 @@ +{Frame designer}
+const
+ // trackbar
+ opt_tbleft :pAnsiChar='frame/designer/trackbar/left';
+ opt_tbtop :pAnsiChar='frame/designer/trackbar/top';
+ opt_tbwidth :pAnsiChar='frame/designer/trackbar/width';
+ opt_tbheight:pAnsiChar='frame/designer/trackbar/height';
+ // text block
+ opt_tleft :pAnsiChar='frame/designer/text/left';
+ opt_ttop :pAnsiChar='frame/designer/text/top';
+ opt_twidth :pAnsiChar='frame/designer/text/width';
+ opt_theight :pAnsiChar='frame/designer/text/height';
+ // buttons (with number)
+ opt_bleft :pAnsiChar='frame/designer/buttons/left';
+ opt_btop :pAnsiChar='frame/designer/buttons/top';
+
+procedure TWATFrame.DesignerSaveSettings;
+var
+ i:integer;
+ D:PWATFrameData;
+ lleft,ltop:array [0..63] of AnsiChar;
+ pleft,ptop:PAnsiChar;
+begin
+ D:=CustomData;
+ if D.TrackBar<>nil then
+ begin
+ DBWriteWord(0,PluginShort,opt_tbleft ,D.Trackbar.Left);
+ DBWriteWord(0,PluginShort,opt_tbtop ,D.Trackbar.Top);
+ DBWriteWord(0,PluginShort,opt_tbwidth ,D.Trackbar.Width);
+ DBWriteWord(0,PluginShort,opt_tbheight,D.Trackbar.Height);
+ end;
+
+ if D.TextBlock<>nil then
+ begin
+ DBWriteWord(0,PluginShort,opt_tleft ,D.TextBlock.Left);
+ DBWriteWord(0,PluginShort,opt_ttop ,D.TextBlock.Top);
+ DBWriteWord(0,PluginShort,opt_twidth ,D.TextBlock.Width);
+ DBWriteWord(0,PluginShort,opt_theight,D.TextBlock.Height);
+ end;
+
+ if (D.ShowControls and scButtons)<>0 then
+ begin
+ if D.btnarray[0]<>nil then
+ begin
+ pleft:=StrCopyE(lleft,opt_bleft);
+ ptop :=StrCopyE(ltop ,opt_btop);
+ for i:=0 to HIGH(D.btnarray) do
+ begin
+ IntToStr(pleft,i); DBWriteWord(0,PluginShort,lleft,D.btnarray[i].Left);
+ IntToStr(ptop ,i); DBWriteWord(0,PluginShort,ltop ,D.btnarray[i].Top);
+ end;
+ end;
+ end;
+end;
+
+procedure TWATFrame.DesignerLoadSettings;
+var
+ i:integer;
+ D:PWATFrameData;
+ lleft,ltop:array [0..63] of AnsiChar;
+ pleft,ptop:PAnsiChar;
+ for_check:integer;
+begin
+ D:=CustomData;
+
+ if (D.TrackBar<>nil) and
+ ((D.ShowControls and scTrackbar)<>0) and
+ ((D.Loaded and scTrackbar)=0) then
+ begin
+ D.Loaded:=D.Loaded or scTrackbar;
+ for_check:=DBReadWord(0,PluginShort,opt_tbwidth);
+ if for_check<>0 then
+ begin
+ D.Trackbar.SetPosition(
+ DBReadWord(0,PluginShort,opt_tbleft),
+ DBReadWord(0,PluginShort,opt_tbtop));
+ D.Trackbar.SetSize(
+ for_check,
+ {18}DBReadWord(0,PluginShort,opt_tbheight));
+ end;
+ end;
+
+ if (D.TextBlock<>nil) and
+ ((D.ShowControls and scText)<>0) and
+ ((D.Loaded and scText)=0) then
+ begin
+ D.Loaded:=D.Loaded or scText;
+ for_check:=DBReadWord(0,PluginShort,opt_twidth);
+ if for_check<>0 then
+ begin
+ D.TextBlock.SetPosition(
+ DBReadWord(0,PluginShort,opt_tleft),
+ DBReadWord(0,PluginShort,opt_ttop));
+ D.TextBlock.SetSize(
+ for_check,
+ DBReadWord(0,PluginShort,opt_theight));
+ end;
+ end;
+
+ if ((D.ShowControls and scButtons)<>0) and
+ ((D.Loaded and scButtons)=0) then
+ begin
+ if D.btnarray[0]<>nil then
+ begin
+ D.Loaded:=D.Loaded or scButtons;
+ pleft:=StrCopyE(lleft,opt_bleft);
+ pleft^:='0'; (pleft+1)^:=#0;
+ for_check:=SmallInt(DBReadWord(0,PluginShort,lleft,word(-1)));
+ if for_check>=0 then
+ begin
+ ptop :=StrCopyE(ltop,opt_btop);
+ for i:=0 to HIGH(D.btnarray) do
+ begin
+ IntToStr(pleft,i);
+ IntToStr(ptop ,i);
+ D.btnarray[i].SetPosition(
+ DBReadWord(0,PluginShort,lleft,word(-1)),
+ DBReadWord(0,PluginShort,ltop ,word(-1)));
+ end;
+ end;
+ end;
+ end;
+end;
+
+procedure TWATFrame.CreateDesigner(Sender:PControl;var Mouse:TMouseEventData);
+var
+ D:PWATFrameData;
+begin
+ D:=CustomData;
+ if not D.ManualPlacement then exit;
+
+ if D.Designer=nil then
+ D.Designer:=NewDesigner(@self);
+
+ if not D.Designer.Active then
+ begin
+ // Trackbar
+ if D.Trackbar<>nil then
+ begin
+ D.Trackbar.Anchor(false,false,false,false);
+ D.Designer.Connect('Trackbar',D.Trackbar);
+ end;
+ // TextBlock
+ if D.TextBlock<>nil then
+ begin
+ D.TextBlock.Anchor(false,false,false,false);
+ D.Designer.Connect('Panel',D.TextBlock);
+ end;
+ // Icons
+ if (D.ShowControls and scButtons)<>0 then MakeButtonsDesigner;
+
+ D.Designer.Active:=true;
+ end
+ else
+ begin
+ D.Designer.Active:=False;
+
+ DesignerSaveSettings;
+ if D.Trackbar <>nil then D.Designer.Disconnect(D.Trackbar);
+ if D.TextBlock<>nil then D.Designer.Disconnect(D.TextBlock);
+ if (D.ShowControls and scButtons)<>0 then FreeButtonsDesigner;
+ Sender.Update;
+ end;
+end;
|