Develop and Download Open Source Software

Browse Subversion Repository

Contents of /old/winpaint.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25 - (show annotations) (download)
Wed Jan 2 22:49:32 2008 UTC (16 years, 3 months ago) by tabasa
File MIME type: text/plain
File size: 3336 byte(s)


1
2 #include "defextern.h"
3
4
5 #ifndef STRICT
6 #define STRICT
7 #endif
8 #include <stdio.h>
9 #include <windows.h>
10
11 #include "main.h"
12 #include "mode.h"
13 #include "initial.h"
14 #include "paintflag.h"
15 #include "winpaint.h"
16 #include "tab.h"
17
18 #define resize() SendMessage(hmainwnd,WM_SIZE,0,0);
19
20
21 void winp::BitBlt(HDC hdc, HDC mem, int wx, int wy)
22 {
23 wx = (wx==0) ? insideX : wx;
24 wy = (wy==0) ? insideY : wy;
25 pX =0; pY =0;
26 pW =wx; pH =wy+status_h;
27 memX =0;//oX;
28 memY =0;//oY;
29
30 if(ntab ==tab_r || mode==W_MODE_EDITONLY)
31 {
32 pX =diredit_l;
33 }
34 else
35 {
36 pX =xL +buttonx/2;
37 }
38 ::BitBlt(hdc, pX,pY,pW,pH, mem, memX, memY, SRCCOPY);
39 }
40
41 void winp::set(HWND dr,HWND dl,HWND der, HWND del, HWND u, HWND d, HWND ed, HWND ta)
42 {
43 hDir =dr;
44 hDirL =dl;
45 hDirEdit =der;
46 hDirEditL =del;
47 hUp =u;
48 hDown =d;
49 hEdit =ed;
50 hTab =ta;
51 }
52
53 #define windf(hW, x, y, wx, wy) DeferWindowPos(hDwp, hW, HWND_TOP, x, y, wx, wy, SWP_SHOWWINDOW)
54
55 void winp::mvWins()
56 {
57 HDWP hDwp;
58 hDwp = BeginDeferWindowPos(9);
59 hDwp = windf( hTab, diredit_l, tab_top, edit_w, tab_h );
60 hDwp = windf( hDirL, xL -dir_w, dir_ueh, dir_w, dirL_h );
61 hDwp = windf( hDir, xL , dir_ueh, dir_w, dirR_h );
62 hDwp = windf( hDirEditL, diredit_l, dir_ueh, xL -dir_w, dirL_h);
63 hDwp = windf( hDirEdit, xL +dir_w, dir_ueh, xR -dir_w, dirR_h);
64 hDwp = windf( hListL, diredit_l, listtop, xL -buttonx/2, listLy);
65 hDwp = windf( hList, xL +buttonx/2, listtop, xR - buttonx/2, listRy );
66 hDwp = windf( hUp, xL -buttonx/2, listtop +listy/2 -25, buttonx, buttony);
67 hDwp = windf( hDown, xL -buttonx/2, listtop +listy/2 +15, buttonx, buttony);
68 hDwp = windf( hEdit, diredit_l, edittop, edit_w, edity);
69 EndDeferWindowPos( hDwp );
70 }
71
72 void winp::setSizePara(LPARAM lp, int nStatus_h, BOOL picflg, int tab, int ListLWidth)
73 {
74 sizelp=lp;
75 dir_h = 30;
76 if(DirEditMode==_HIDE) dir_h = 0;
77 tab_h =33;
78 tab_top =0;
79 dir_ueh = tab_h;//5;//dir ����
80 dir_sitah = 0;//5;
81 diredit_l =0;
82 dir_w =15;
83 insideX =LOWORD(lp);
84 edit_w =insideX;
85 status_h =nStatus_h;
86 insideY =HIWORD(lp) - nStatus_h;//��������
87 listy =insideY -dir_h -dir_ueh -dir_sitah;
88 if(videoIn)
89 {
90 listy =0;
91 buttonx=0;
92 buttony=0;
93 dir_h =0;
94 tab_h=0;
95 }
96 else
97 {
98 if(mode==W_MODE_LISTnEDIT)
99 {
100 listy /=2;
101 listy =max(listy, 100);
102 }
103 if(mode==W_MODE_EDITONLY)
104 {
105 listy =0;
106 buttonx=0;
107 buttony=0;
108 dir_h =0;
109 tab_h=0;
110 }
111 else
112 {
113 buttonx=22;
114 buttony=24;
115 }
116 }
117 if(ButtonMode==_HIDE) { buttonx =0; dir_w =0;}
118 if(mode==W_MODE_LIST) ;
119 dirR_h =dir_h;
120 dirL_h =dir_h;
121 listtop =dir_h +dir_ueh +dir_sitah;
122 edittop =listtop +listy;
123 edity =insideY -listy -listtop;
124 xLpercent =ListLWidth;
125 xRpercent =100 -xLpercent;
126 xL =(float)insideX /100 *xLpercent;
127 xR =insideX -xL;
128 listLy =listy;
129 listRy =listy;
130 if(picflg )
131 {
132 ntab =tab;
133 if(tab ==tab_r) {listLy =0; dirL_h =0;}
134 if(tab ==tab_l) {listRy =0; dirR_h =0;}
135 edity =0;
136 }
137 }
138
139
140 void WinFlash(HWND hWnd)
141 {
142 ShowWindow( hWnd, SW_HIDE);
143 ShowWindow( hWnd, SW_SHOW);
144 }
145
146 void TitleBar(HWND hWnd)
147 {
148 int style = GetWindowLong(hWnd, GWL_STYLE);
149 static BOOL f = ( style == (style | WS_CAPTION) );
150 if(f)
151 {
152 style = (style & ~WS_CAPTION);
153 f =FALSE;
154 }
155 else
156 {
157 style = (style | WS_CAPTION);
158 f =TRUE;
159 }
160 SetWindowLong( hWnd, GWL_STYLE, style);
161 ShowWindow( hWnd, SW_HIDE);
162 ShowWindow( hWnd, SW_SHOW);
163 }
164

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision
svn:mime-type text/plain

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26