summaryrefslogtreecommitdiff
path: root/plugins/Watrack/HlpDlg.pas
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-10-08 18:43:29 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-10-08 18:43:29 +0000
commit864081102a5f252415f41950b3039a896b4ae9c5 (patch)
treec6b764651e9dd1f8f53b98eab05f16ba4a492a79 /plugins/Watrack/HlpDlg.pas
parentdb5149b48346c417e18add5702a9dfe7f6e28dd0 (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/HlpDlg.pas')
-rw-r--r--plugins/Watrack/HlpDlg.pas83
1 files changed, 83 insertions, 0 deletions
diff --git a/plugins/Watrack/HlpDlg.pas b/plugins/Watrack/HlpDlg.pas
new file mode 100644
index 0000000000..c420345bd4
--- /dev/null
+++ b/plugins/Watrack/HlpDlg.pas
@@ -0,0 +1,83 @@
+{help dialogs}
+unit HlpDlg;
+
+interface
+
+uses windows;
+
+const
+ sFormatHelp:PWideChar = 'Text format codes'#13#10'{b}text{/b}'#9'bold'#13#10+
+ '{i}text{/i}'#9'italic'#13#10'{u}text{/u}'#9'undeline'#13#10+
+ '{cf##}text{/cf}'#9'text color'#13#10'{bg##}text{/bg}'#9+
+ 'background color'#13#10'text - user text'#13#10+
+ '## - color number (1-16)'#13#10'Color 0 is background color'#13#10+
+ 'Color 17 is default text color';
+
+function ShowColorHelpDlg(parent:HWND):integer;
+
+implementation
+
+uses messages,m_api;
+
+{$include res\i_const.inc}
+
+const
+ colors:array [0..15] of dword = (
+ $00FFFFFF,$00000000,$007F0000,$00009300,
+ $000000FF,$0000007F,$009C009C,$00007FFC,
+ $0000FFFF,$0000FC00,$00939300,$00FFFF00,
+ $00FC0000,$00FF00FF,$007F7F7F,$00D2D2D2
+ );
+
+const
+ COLORDLG = 'COLOR';
+
+function ColorHelpDlg(Dialog:HWnd;hMessage,wParam,lParam:DWord):integer; stdcall;
+var
+ ps:tPaintStruct;
+ br:hBrush;
+ dc:hDC;
+ rc:tRect;
+ i,j:integer;
+begin
+ case hMessage of
+ WM_INITDIALOG: begin
+ TranslateDialogDefault(Dialog);
+ end;
+ WM_COMMAND:
+ if (wParam shr 16)=BN_CLICKED then
+ case loword(wParam) of
+ IDOK, IDCANCEL: DestroyWindow(Dialog);
+ end;
+ WM_PAINT: begin
+ dc:=BeginPaint(Dialog,ps);
+ SetBkColor(dc,GetSysColor(COLOR_BTNFACE));
+ for i:=0 to 1 do
+ begin
+ for j:=0 to 7 do
+ begin
+ with rc do
+ begin
+ left :=32+i*66;
+ top :=10+j*18;
+ right :=56+i*66;
+ bottom:=24+j*18;
+ end;
+ br:=CreateSolidBrush(colors[i*8+j]);
+ Rectangle(dc,rc.left-1,rc.top-1,rc.right+1,rc.bottom+1);
+ FillRect(dc,rc,br);
+ DeleteObject(br);
+ end;
+ end;
+ EndPaint(Dialog,ps);
+ end;
+ end;
+ result:=0;
+end;
+
+function ShowColorHelpDlg(parent:HWND):integer;
+begin
+ result:=CreateDialogW(hInstance,COLORDLG,parent,@ColorHelpDlg);
+end;
+
+end. \ No newline at end of file