Mercurial > otakunoraifu
annotate window/widget.cc @ 52:15a18fbe6f21
* Known bugs added to the README
* Code cleaning (0 -> NULL when needed, indentation, spaces, ...)
author | thib |
---|---|
date | Sat, 18 Apr 2009 18:35:39 +0000 |
parents | 5f548e5957a8 |
children | ddbcbd000206 |
rev | line source |
---|---|
0 | 1 /* |
2 * Copyright (c) 2004-2006 Kazunori "jagarl" Ueno | |
3 * All rights reserved. | |
4 * | |
5 * Redistribution and use in source and binary forms, with or without | |
6 * modification, are permitted provided that the following conditions | |
7 * are met: | |
8 * 1. Redistributions of source code must retain the above copyright | |
9 * notice, this list of conditions and the following disclaimer. | |
10 * 2. Redistributions in binary form must reproduce the above copyright | |
11 * notice, this list of conditions and the following disclaimer in the | |
12 * documentation and/or other materials provided with the distribution. | |
13 * 3. The name of the author may not be used to endorse or promote products | |
14 * derived from this software without specific prior written permission. | |
15 * | |
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
26 */ | |
27 | |
52 | 28 #include "widget.h" |
29 #include <algorithm> | |
30 #include <map> | |
31 #include <string> | |
0 | 32 |
33 Rect DSurfaceRenderText(TextGlyphStream::iterator start, TextGlyphStream::iterator end, const Rect& srcrect, | |
34 Surface* dst, const Rect& dstrect); | |
35 void DSurfaceFill(Surface* src, const Rect& rect, int r, int g, int b, int a = 0xff); | |
36 void DSurfaceMove(Surface* src, const Rect& srcrect, Surface* dst_o, const Rect& dstrect); | |
37 | |
38 //static char* wdefault_font_orig = "msgothic.ttc;times.ttf;"; | |
39 static std::map<int, XKFont::HorizLayout*> size_to_layout; | |
47
5f548e5957a8
* get rid of the "deprecated conversion from string constant to ‘char*’" warnings
thib
parents:
14
diff
changeset
|
40 static const char* wdefault_font_orig = "times.ttf;msgothic.ttc"; |
0 | 41 static std::string wdefault_font = wdefault_font_orig; |
42 | |
43 void SetFont(const char* font) { | |
44 if (font == 0) return; | |
45 std::map<int,XKFont::HorizLayout*>::iterator it; | |
46 for (it=size_to_layout.begin(); it != size_to_layout.end(); it++) { | |
47 delete it->second; | |
48 } | |
49 size_to_layout.clear(); | |
50 wdefault_font = font; | |
51 } | |
52 | 52 |
0 | 53 // namespace Widget { |
54 #define TimeCursor WidTimeCursor | |
55 #define MouseCursor WidMouseCursor | |
56 #define Button WidButton | |
57 #define Scale WidScale | |
58 #define TextButton WidTextButton | |
59 #define Text WidText | |
60 #define AnmTime WidAnmTime | |
61 #define AnmMove WidAnmMove | |
62 #define AnmAlpha WidAnmAlpha | |
63 #define AnmPtnSolid WidAnmPtnSolid | |
64 #define AnmPtnAlpha WidAnmPtnAlpha | |
65 | |
66 XKFont::HorizLayout* DefaultLayout(int text_size) { | |
14
8da1d92ac8f8
Don't create fonts faces for size <= 0, and update objects when their font size is set
thib
parents:
0
diff
changeset
|
67 if(text_size <= 0) abort();//FIXME: Find why the hell text_size can be <= 0 |
0 | 68 if (size_to_layout.find(text_size) == size_to_layout.end()) { |
69 size_to_layout[text_size] = new XKFont::HorizLayout(wdefault_font.c_str(), text_size); | |
70 } | |
71 return size_to_layout[text_size]; | |
72 } | |
73 | |
74 void PicWidget::activate(void) { | |
75 } | |
52 | 76 |
0 | 77 void PicWidget::deactivate(void) { |
78 } | |
52 | 79 |
0 | 80 void PicWidget::SetRegion(const Rect& apos) { |
81 } | |
52 | 82 |
0 | 83 void PicWidget::show(void) { |
84 Pic()->show(); | |
85 } | |
52 | 86 |
0 | 87 void PicWidget::hide(void) { |
88 Pic()->hide(); | |
89 } | |
52 | 90 |
0 | 91 void PicWidget::show_all(void) { |
92 Pic()->show_all(); | |
93 } | |
94 | |
95 TimeCursor::TimeCursor(Event::Container& container, int _interval, PicContainer* parent, const char* s, int _sx, int _sy, int _sdx, int _sdy, int _nptn, const Rect& r) : | |
96 Time(container) { | |
97 interval = _interval; | |
98 if (interval < 0) interval = 100; | |
99 nptn = _nptn; | |
100 if (nptn < 0) nptn = 1; | |
101 count = 0; old_time = 0; | |
102 | |
103 x = _sx; y = _sy; dx = _sdx; dy = _sdy; | |
104 SetPic(parent->create_leaf(r, PicBase::CACHE_BACK)); | |
105 Pic()->SetSurface(s, _sx, _sy); | |
106 }; | |
107 void TimeCursor::Elapsed(unsigned int current_time) { | |
108 int move = (current_time-old_time)/interval; | |
109 if (move) { | |
110 old_time += move*interval; | |
111 count += move; | |
112 count %= nptn; | |
113 Pic()->SetSurfacePos(x + count*dx, y + count*dy); | |
114 } | |
115 if (current_time > old_time+interval) SetWakeup(current_time); | |
116 else SetWakeup(old_time+interval); | |
117 } | |
118 | |
119 MouseCursor::MouseCursor(Event::Container& _container, PicContainer* parent, const char* s, int x, int y, int w, int h) : | |
120 Event::Video(_container), container(_container) { | |
121 int sx, sy; | |
122 _container.MousePos(sx, sy); | |
123 SetPic(parent->create_leaf(Rect(sx, sy, sx+w, sy+h), 0)); | |
124 Pic()->SetSurface(s, x, y); | |
125 x = 0; y = 0; | |
126 container.RegisterGlobalMotionFunc(&Motionfunc, (void*)this); | |
127 } | |
52 | 128 |
0 | 129 MouseCursor::MouseCursor(Event::Container& _container, PicContainer* parent, Surface* s, int x, int y, int w, int h) : |
130 Event::Video(_container), container(_container) { | |
131 int sx, sy; | |
132 _container.MousePos(sx, sy); | |
133 SetPic(parent->create_leaf(Rect(sx, sy, sx+w, sy+h), 0)); | |
134 Pic()->SetSurface(s, x, y); | |
135 x = 0; y = 0; | |
136 container.RegisterGlobalMotionFunc(&Motionfunc, (void*)this); | |
137 } | |
138 | |
139 MouseCursor::~MouseCursor() { | |
140 container.DeleteGlobalMotionFunc(&Motionfunc, (void*)this); | |
141 } | |
142 | |
143 bool MouseCursor::Motionfunc(int x, int y, void* pointer) { | |
144 MouseCursor* _this = (MouseCursor*)pointer; | |
145 // º¸¾å¤¬¥«¡¼¥½¥ë¥Ý¥¤¥ó¥È¤Î¾ì¹ç | |
146 // _this->Pic()->Move(x,y); | |
147 // º¸²¼¤¬¥«¡¼¥½¥ë¥Ý¥¤¥ó¥È¤Î¾ì¹ç | |
148 _this->Pic()->Move(x,y-_this->Pic()->Height()); | |
149 return true; | |
150 } | |
151 | |
152 Button::Button(Event::Container& container, PicContainer* parent, const char* s, int _sx, int _sy, int _sdx, int _sdy, int _nptn, const Rect& r, int _z) : sx(_sx), sy(_sy), sdx(_sdx), sdy(_sdy), nptn(_nptn) ,Event::Video(container,r, _z) { | |
153 SetPic(parent->create_leaf(r, 0)); | |
154 Pic()->SetSurface(s, _sx, _sy); | |
155 show(); | |
156 is_in = false; | |
157 is_toggled = false; | |
52 | 158 press_func = NULL; |
159 press_pointer = NULL; | |
160 drag_func = NULL; | |
161 drag_pointer = NULL; | |
0 | 162 is_toggle_switch = false; |
163 } | |
52 | 164 |
0 | 165 Button::Button(Event::Container& container, PicContainer* parent, Surface* s, int _sx, int _sy, int _sdx, int _sdy, int _nptn, const Rect& r, int _z) : sx(_sx), sy(_sy), sdx(_sdx), sdy(_sdy), nptn(_nptn) ,Event::Video(container,r, _z) { |
166 SetPic(parent->create_leaf(r, 0)); | |
167 Pic()->SetSurface(s, _sx, _sy); | |
168 show(); | |
169 is_in = false; | |
170 is_toggled = false; | |
52 | 171 press_func = NULL; |
172 press_pointer = NULL; | |
173 drag_func = NULL; | |
174 drag_pointer = NULL; | |
0 | 175 is_toggle_switch = false; |
176 } | |
52 | 177 |
0 | 178 Button::~Button() { |
179 } | |
52 | 180 |
0 | 181 void Button::In(void) { |
182 is_in = true; | |
183 if (nptn > 1) | |
184 if (! is_toggled) | |
185 Pic()->SetSurfacePos(sx+sdx, sy+sdy); | |
186 } | |
52 | 187 |
0 | 188 void Button::Out(void) { |
189 is_in = false; | |
190 if (!is_toggled) | |
191 Pic()->SetSurfacePos(sx, sy); | |
192 } | |
52 | 193 |
0 | 194 void Button::Toggle(bool new_toggle) { |
195 if (is_toggled == new_toggle) { | |
196 return; | |
197 } | |
198 is_toggled = new_toggle; | |
199 // if (is_in) return; // is_in ¤Ë´Ø¤ï¤é¤º¥¦¥£¥¸¥Ã¥È¤Îɽ¼¨¤òÊѹ¹¤¹¤ë¤³¤È¤Ë¤¹¤ë | |
200 if (is_toggled) { | |
201 if (nptn > 2) | |
202 Pic()->SetSurfacePos(sx+sdx*2, sy+sdy*2); | |
203 else if (nptn > 1) | |
204 Pic()->SetSurfacePos(sx+sdx, sy+sdy); | |
205 else | |
206 Pic()->SetSurfacePos(sx, sy); | |
207 } else { | |
208 Pic()->SetSurfacePos(sx, sy); | |
209 } | |
210 } | |
52 | 211 |
0 | 212 void Button::Press(void) { |
213 is_in = true; | |
214 if (is_toggled) ; | |
215 else if (nptn > 2) | |
216 Pic()->SetSurfacePos(sx+sdx*2, sy+sdy*2); | |
217 else if (nptn > 1) | |
218 Pic()->SetSurfacePos(sx+sdx, sy+sdy); | |
219 if (press_func) press_func(press_pointer, this); | |
220 if (is_toggle_switch) Toggle(!is_toggled); | |
221 } | |
52 | 222 |
0 | 223 void Button::Release(void) { |
224 if (is_toggled) ; | |
225 else if (nptn > 1 && is_in) | |
226 Pic()->SetSurfacePos(sx+sdx, sy+sdy); | |
227 else if (nptn > 1) | |
228 Pic()->SetSurfacePos(sx, sy); | |
229 } | |
52 | 230 |
0 | 231 void Button::Drag(int x_from, int y_from, int x_to, int y_to) { |
232 if (drag_func) drag_func(x_from,y_from,x_to, y_to,drag_pointer, this); | |
233 } | |
234 | |
235 Scale::Scale(Event::Container& _container, PicContainer* _parent, const Rect& r_orig, const Color& _color, bool _is_vertical) : | |
236 Event::Video(_container,Rect(0,0), 1), | |
237 container(_container), parent(_parent), cursor_color(_color), | |
238 mouse_x(0), mouse_y(0), max(0), min(0), | |
239 value(0), value_add(0), value_dragstart(0), is_vertical(_is_vertical), | |
240 change_func(0), change_pointer(0) { | |
241 | |
52 | 242 arrow_down = NULL; |
243 arrow_up = NULL; | |
244 cursor = NULL; | |
245 panel = NULL; | |
0 | 246 |
247 Init(r_orig); | |
248 } | |
249 | |
250 extern char* create_button(int number, int& width, int& height, int r, int g, int b); | |
251 extern char* create_box(int& width, int& height, int r, int g, int b); | |
52 | 252 |
0 | 253 void Scale::Init(Rect r_orig) { |
254 int r=cursor_color.r, g=cursor_color.g, b=cursor_color.b; | |
255 // Ìð°õ | |
256 int arrow_width = -1; | |
257 cursor_width = -1; | |
258 char* button1; | |
259 char* button2; | |
260 if (is_vertical) { | |
261 // Ìð°õ¤ËɬÍפÊÎΰè³ÎÊÝ | |
262 int arrow_height = r_orig.width(); | |
263 button1 = create_button(2, arrow_height, arrow_width, r, g, b); | |
264 button2 = create_button(3, arrow_height, arrow_width, r, g, b); | |
265 if (r_orig.height() < arrow_width*4) { | |
266 if (r_orig.height() < 8) r_orig.by = r_orig.ty + 8; // ¾®¤µ¤¹¤®¤ë¾ì¹ç¤Ï¶¯À©Êѹ¹ | |
267 free( (void*)button1); | |
268 free( (void*)button2); | |
269 arrow_width = r_orig.height()/4; | |
270 // ºÆ³ä¤êÅö¤Æ | |
271 button1 = create_button(2, arrow_height, arrow_width, r, g, b); | |
272 button2 = create_button(3, arrow_height, arrow_width, r, g, b); | |
273 } | |
274 // Ìð°õ¥Ü¥¿¥ó¤ÎºîÀ® | |
275 Surface* a1s = parent->Root().NewSurfaceFromRGBAData(arrow_height, arrow_width*3, button1, ALPHA_MASK); | |
276 int x = r_orig.lx; int y = r_orig.ty; | |
277 arrow_up = new Button(container, parent, a1s, 0, 0, 0, arrow_width, 3, Rect(x,y,x+arrow_height,y+arrow_width),1); | |
278 arrow_up->Pic()->SetSurfaceFreeFlag(); | |
279 Surface* a2s = parent->Root().NewSurfaceFromRGBAData(arrow_height, arrow_width*3, button2, ALPHA_MASK); | |
280 x = r_orig.rx - arrow_height; y = r_orig.by - arrow_width; | |
281 arrow_down = new Button(container, parent, a2s, 0, 0, 0, arrow_width, 3, Rect(x,y,x+arrow_height,y+arrow_width),1); | |
282 arrow_down->Pic()->SetSurfaceFreeFlag(); | |
283 // pictureºîÀ®¡Ê¥Ü¥¿¥ó¤ÎÆ°¤¯Îΰè¡Ë | |
284 Rect r = r_orig; | |
285 r.ty += arrow_width; | |
286 r.by -= arrow_width; | |
287 panel = parent->create_node(r, 0); | |
288 SetPic(panel); | |
289 // ¥Ü¥¿¥ó¤ÎÃæ¿´Àþ¤òÉÁ²è¡¢ÀßÄê | |
290 Surface* s = parent->Root().NewSurface(r.width()/2, r.height(), ALPHA_MASK); | |
291 DSurfaceFill(s, Rect(0,0,r.width()/2,r.height()), 0, 0, 0, 0xff); | |
292 Pic()->SetSurface(s, -r.width()/4, 0, 0); | |
293 Pic()->SetSurfaceFreeFlag(); | |
294 } else { | |
295 // Ìð°õ¤ËɬÍפÊÎΰè³ÎÊÝ | |
296 int arrow_height = r_orig.height(); | |
297 button1 = create_button(0, arrow_width, arrow_height, r, g, b); | |
298 button2 = create_button(1, arrow_width, arrow_height, r, g, b); | |
299 if (r_orig.width() < arrow_width*4) { | |
300 if (r_orig.width() < 8) r_orig.rx = r_orig.lx + 8; // ¾®¤µ¤¹¤®¤ë¾ì¹ç¤Ï¶¯À©Êѹ¹ | |
301 free( (void*)button1); | |
302 free( (void*)button2); | |
303 arrow_width = r_orig.width()/4; | |
304 // ºÆ³ä¤êÅö¤Æ | |
305 button1 = create_button(2, arrow_width, arrow_height, r, g, b); | |
306 button2 = create_button(3, arrow_width, arrow_height, r, g, b); | |
307 } | |
308 // Ìð°õ¥Ü¥¿¥ó¤ÎºîÀ® | |
309 Surface* a1s = parent->Root().NewSurfaceFromRGBAData(arrow_width, arrow_height*3, button1, ALPHA_MASK); | |
310 int x = r_orig.lx; int y = r_orig.ty; | |
311 arrow_up = new Button(container, parent, a1s, 0, 0, 0, arrow_height, 3, Rect(x,y,x+arrow_width,y+arrow_height),1); | |
312 arrow_up->Pic()->SetSurfaceFreeFlag(); | |
313 Surface* a2s = parent->Root().NewSurfaceFromRGBAData(arrow_width, arrow_height*3, button2, ALPHA_MASK); | |
314 x = r_orig.rx - arrow_width; y = r_orig.by - arrow_height; | |
315 arrow_down = new Button(container, parent, a2s, 0, 0, 0, arrow_height, 3, Rect(x,y,x+arrow_width,y+arrow_height),1); | |
316 arrow_down->Pic()->SetSurfaceFreeFlag(); | |
317 // pictureºîÀ®¡Ê¥Ü¥¿¥ó¤ÎÆ°¤¯Îΰè¡Ë | |
318 Rect r = r_orig; | |
319 r.lx += arrow_width; | |
320 r.rx -= arrow_width; | |
321 panel = parent->create_node(r, 0); | |
322 SetPic(panel); | |
323 // ¥Ü¥¿¥ó¤ÎÃæ¿´Àþ¤òÉÁ²è¡¢ÀßÄê | |
324 Surface* s = parent->Root().NewSurface(r.width(), r.height()/2, ALPHA_MASK); | |
325 DSurfaceFill(s, Rect(0,0,r.width(),r.height()/2), 0, 0, 0, 0xff); | |
326 Pic()->SetSurface(s, 0, -r.height()/4, 0); | |
327 Pic()->SetSurfaceFreeFlag(); | |
328 } | |
329 arrow_up->press_func = &Scale::PressArrowUp; | |
330 arrow_up->press_pointer = (void*)this; | |
331 arrow_down->press_func = &Scale::PressArrowDown; | |
332 arrow_down->press_pointer = (void*)this; | |
333 arrow_up->show(); | |
334 arrow_down->show(); | |
335 panel->show(); | |
336 InitCursor(0); | |
337 } | |
338 | |
339 void Scale::InitCursor(int width_ratio) { | |
340 int r=cursor_color.r, g=cursor_color.g, b=cursor_color.b; | |
52 | 341 if (cursor != NULL) delete cursor; |
342 cursor = NULL; | |
0 | 343 Rect region(0,0); |
344 if (width_ratio < 0) width_ratio = 0; | |
345 else if (width_ratio > 1024) width_ratio = 1024; | |
346 if (is_vertical) { | |
347 if (width_ratio == 0) cursor_width = Pic()->Width() * 3 / 2; // Éý¤Î1.5ÇÜ | |
348 else cursor_width = Pic()->Height()*width_ratio/1024; | |
349 if (cursor_width <= 0) return; // ¥«¡¼¥½¥ë¤Ê¤·¡Ê¤¤¤¤¤Î¤«¡©¡Ë | |
350 region = Rect(0, 0, Pic()->Width(), cursor_width); | |
351 } else { // horizontal | |
352 if (width_ratio == 0) cursor_width = Pic()->Height() * 3 / 2; // ¹â¤µ¤Î1.5ÇÜ | |
353 else cursor_width = Pic()->Width()*width_ratio/1024; | |
354 if (cursor_width <= 0) return; // ¥«¡¼¥½¥ë¤Ê¤·¡Ê¤¤¤¤¤Î¤«¡©¡Ë | |
355 region = Rect(0, 0, cursor_width, Pic()->Height()); | |
356 } | |
357 | |
358 int height = region.height(); | |
359 int width = region.width(); | |
360 char* box = create_box(width, height, r, g, b); | |
361 Surface* boxs = parent->Root().NewSurfaceFromRGBAData(width, height*3, box, ALPHA_MASK); | |
362 cursor = new Button(container, panel, boxs, 0, 0, 0, height, 3, region, 2); | |
363 cursor->Pic()->SetSurfaceFreeFlag(); | |
364 | |
365 cursor->press_func = &Scale::PressCursor; | |
366 cursor->press_pointer = (void*)this; | |
367 cursor->drag_func = &Scale::DragCursor; | |
368 cursor->drag_pointer = (void*)this; | |
369 cursor->show(); | |
370 | |
371 // Ìð°õÅù¤ò¥¯¥ê¥Ã¥¯¤·¤¿¤È¤¤Î°ÜÆ°ÎÌ·×»» | |
372 int bar_width; | |
373 if (is_vertical) bar_width = Pic()->Height(); | |
374 else bar_width = Pic()->Width(); | |
375 if (bar_width <= 0) value_add = max-min; | |
376 else if (cursor_width == 0) value_add = 2; | |
377 else value_add = scale_max*cursor_width/bar_width; | |
378 } | |
379 | |
380 void Scale::PressArrowDown(void* pointer, Button* from) { | |
381 Scale* self = (Scale*)pointer; | |
382 self->SetScaleValue(self->value + self->value_add); | |
383 } | |
52 | 384 |
0 | 385 void Scale::PressArrowUp(void* pointer, Button* from){ |
386 Scale* self = (Scale*)pointer; | |
387 self->SetScaleValue(self->value - self->value_add); | |
388 } | |
52 | 389 |
0 | 390 void Scale::PressCursor(void* pointer, Button* from){ |
391 Scale* self = (Scale*)pointer; | |
392 self->value_dragstart = self->value; | |
393 } | |
52 | 394 |
0 | 395 void Scale::DragCursor(int x_from, int y_from,int x, int y, void* pointer, Button* from){ |
396 Scale* self = (Scale*)pointer; | |
397 int dx, w; | |
398 if (self->is_vertical) { | |
399 dx = y-y_from; | |
400 w = self->Event::Video::Region().height(); | |
401 } else { | |
402 dx = x-x_from; | |
403 w = self->Event::Video::Region().width(); | |
404 } | |
405 if (w == 0) return; | |
406 self->SetScaleValue(self->value_dragstart + dx*scale_max/w); | |
407 } | |
52 | 408 |
0 | 409 int Scale::CalcValue(void) { |
410 Rect own_region = Event::Video::Region(); | |
411 int x, w; | |
412 if (is_vertical) { | |
413 w = own_region.height(); | |
414 x = mouse_y - own_region.ty; | |
415 } else { | |
416 w = own_region.width(); | |
417 x = mouse_x - own_region.lx; | |
418 } | |
419 if (w == 0) return 0; | |
420 if (x < 0) x = 0; | |
421 else if (x > w) x = w; | |
422 return x*scale_max/w; | |
423 } | |
52 | 424 |
0 | 425 void Scale::Press(void){ |
426 int v = CalcValue(); | |
427 if (v < value) SetScaleValue(value-value_add); | |
428 else SetScaleValue(value+value_add); | |
429 } | |
52 | 430 |
0 | 431 void Scale::Motion(int x, int y){ |
432 mouse_x = x; | |
433 mouse_y = y; | |
434 } | |
435 | |
436 void Scale::SetRange(int new_min, int new_max) { | |
437 min = new_min; | |
438 max = new_max; | |
439 SetValue(value); | |
440 } | |
52 | 441 |
0 | 442 void Scale::SetValue(int new_value) { |
443 if (min == max) { | |
444 value = min; | |
445 SetScaleValue(0); | |
446 return; | |
447 } | |
448 int scale_value = (new_value-min) * scale_max / (max-min); | |
449 SetScaleValue(scale_value); | |
450 } | |
52 | 451 |
0 | 452 int Scale::GetValue(void) const{ |
453 return min + value * (max-min) / scale_max; | |
454 } | |
52 | 455 |
0 | 456 void Scale::SetScaleValue(int new_value) { |
457 if (new_value < 0) value = 0; | |
458 else if (new_value > scale_max) value = scale_max; | |
459 else value = new_value; | |
460 if (is_vertical) { | |
461 int h = Pic()->Height(); | |
462 int y = (h-cursor_width) * value / scale_max; | |
463 if (y < 0) y = 0; | |
464 cursor->Pic()->Move(0, y); | |
465 } else { // horizontal | |
466 int w = Pic()->Width(); | |
467 int x = (w-cursor_width) * value / scale_max; | |
468 if (x < 0) x = 0; | |
469 cursor->Pic()->Move(x, 0); | |
470 } | |
471 if (change_func) { | |
472 (*change_func)(change_pointer, this); | |
473 } | |
474 } | |
475 | |
476 TextButton::TextButton(Event::Container& container, PicContainer* parent, const char* text, int _text_size, Attribute attr, const Rect& r_orig, int _z, const Color& _fore, const Color& _pressed, const Color& _back) : | |
477 Button(container, parent, (Surface*)0, 0, 0, 0, 0, 0, r_orig, _z), | |
478 root(parent->Root()), surface(0), attribute(attr), text_size(_text_size), | |
479 fore(_fore), pressed(_pressed), back(_back) | |
480 { | |
481 bool rect_changed = false; | |
482 // ¤Þ¤º¡¢¥Æ¥¥¹¥ÈÎΰè¤Î¹¤µ¤òÆÀ¤ë | |
483 Rect r(r_orig); | |
484 | |
52 | 485 if (text == NULL) text = ""; |
0 | 486 int width = r.width(); int height = r.height(); |
487 if (width == 0) width = parent->Width() - r.lx; | |
488 | |
489 TextGlyphStream gs = DefaultLayout(text_size)->Layout(text, width); | |
490 | |
491 if (r.width() == 0) { // ʸ»ú¤Ë¹ç¤ï¤»¤Æ¥¦¥£¥¸¥Ã¥ÈºîÀ® | |
492 rect_changed = true; | |
493 width = gs.width() + text_size; | |
494 r.rx = r.lx + gs.width(); | |
495 attribute = Attribute(attribute | CENTER); | |
496 } | |
497 if (r.height() == 0) { | |
498 rect_changed = true; | |
499 if (attribute & NOPADDING) r.by = r.ty + gs.height(); | |
500 else r.by = r.ty + gs.height() + text_size/2; | |
501 } | |
502 | |
503 if (rect_changed) { | |
504 // Â礤µÊѹ¹ | |
505 Pic()->SetSurfaceRect(r); | |
506 } | |
507 | |
52 | 508 sx = 0; sy = 0; sdx = 0; |
509 sdy = r.height(); | |
510 nptn = 3; | |
0 | 511 int x = 0, y = 0; |
512 if (attribute & CENTER) | |
513 x = (Pic()->Width() - gs.width()) / 2; | |
514 y = (Pic()->Height() - gs.height()) / 2; | |
515 | |
52 | 516 //FIXME: (back.a == NULL ?) |
0 | 517 if (back.a == 0) { // Çطʤʤ·¡¢¤â¤·¤¯¤Ï¥Ü¥¿¥ó²¡¤Î¾õÂ֤ΤßÇطʤ¢¤ê |
518 surface = root.NewSurface(r.width(), r.height()*2, ALPHA_MASK); | |
519 DSurfaceFill(surface, Rect(*surface), 0, 0, 0, 0); | |
520 if (attribute & REVERSE) { | |
521 DSurfaceFill(surface, Rect(0,r.height(),r.width(),r.height()*2), pressed.r, pressed.g, pressed.b, 0xff); | |
522 } | |
523 gs.SetColor(fore.r, fore.g, fore.b); | |
524 DSurfaceRenderText(gs.begin(), gs.end(), Rect(0,0,gs.width(),gs.height()), surface, Rect(x,y)); | |
525 gs.SetColor(pressed.r, pressed.g, pressed.b); | |
526 if (attribute & REVERSE) { | |
527 gs.SetReverse(true); | |
528 DSurfaceRenderText(gs.begin(), gs.end(), Rect(0,0,gs.width(),gs.height()), surface, Rect(x,y+r.height())); | |
529 gs.SetReverse(false); | |
530 } else { | |
531 DSurfaceRenderText(gs.begin(), gs.end(), Rect(0,0,gs.width(),gs.height()), surface, Rect(x,y+r.height())); | |
532 } | |
533 nptn = 2; | |
534 } else { // ¥Ü¥¿¥ó·¿¤ÎÇطʤ¢¤ê | |
535 /* ¥é¥Ù¥ëÍѤΠSurface ¤òºî¤ë */ | |
536 width = r.width(); height = r.height(); | |
537 char* box = create_box(width, height, back.r, back.g, back.b); | |
538 surface = root.NewSurfaceFromRGBAData(r.width(), r.height()*3, box, ALPHA_MASK); | |
539 | |
540 Surface* text_surface = root.NewSurface(r.width(), r.height(), ALPHA_MASK); | |
541 DSurfaceFill(text_surface, Rect(*text_surface), 0, 0, 0, 0); | |
542 | |
543 gs.SetColor(fore.r, fore.g, fore.b); | |
544 DSurfaceRenderText(gs.begin(), gs.end(), Rect(0,0,gs.width(),gs.height()), text_surface, Rect(x,y)); | |
545 root.BlitSurface(text_surface, Rect(0,0,width,height), surface, Rect(0,0)); | |
546 gs.SetColor(pressed.r, pressed.g, pressed.b); | |
547 DSurfaceRenderText(gs.begin(), gs.end(), Rect(0,0,gs.width(),gs.height()), text_surface, Rect(x,y)); | |
548 root.BlitSurface(text_surface, Rect(0,0,width,height), surface, Rect(0,height)); | |
549 root.BlitSurface(text_surface, Rect(0,0,width,height), surface, Rect(0,height*2)); | |
550 root.DeleteSurface(text_surface); | |
551 } | |
552 | |
553 Pic()->SetSurface(surface, 0, 0); | |
554 show(); | |
555 } | |
52 | 556 |
0 | 557 void TextButton::SetText(const char* text, const Color& _fore, const Color& _pressed, const Color& _back) |
558 { | |
559 int width = Pic()->Width(); int height = Pic()->Height(); | |
560 // ¤Þ¤º¡¢¥Æ¥¥¹¥ÈÎΰè¤Î¹¤µ¤òÆÀ¤ë | |
52 | 561 if (text == NULL) text = ""; |
0 | 562 |
563 TextGlyphStream gs = DefaultLayout(text_size)->Layout(text, width); | |
564 | |
565 int x = 0, y = 0; | |
566 if (attribute & CENTER) { | |
567 x = (width - gs.width()) / 2; | |
568 y = (height - gs.height()) / 2; | |
569 } | |
570 int surf_x = Pic()->SurfacePosX(); | |
571 int surf_y = Pic()->SurfacePosY(); | |
572 Pic()->SetSurface( (Surface*)0,0,0); | |
573 root.DeleteSurface(surface); | |
52 | 574 surface = NULL; |
0 | 575 |
52 | 576 //FIXME: (back.a == NULL) ? |
0 | 577 if (back.a == 0) { // Çطʤʤ· |
578 surface = root.NewSurface(width, height*2, ALPHA_MASK); | |
579 DSurfaceFill(surface, Rect(*surface), 0, 0, 0, 0); | |
580 if (attribute & REVERSE) { | |
581 DSurfaceFill(surface, Rect(0,height,width,height*2), pressed.r, pressed.g, pressed.b, 0xff); | |
582 } | |
583 gs.SetColor(_fore.r, _fore.g, _fore.b); | |
584 DSurfaceRenderText(gs.begin(), gs.end(), Rect(0,0,gs.width(),gs.height()), surface, Rect(x,y)); | |
585 gs.SetColor(_pressed.r, _pressed.g, _pressed.b); | |
586 gs.SetReverse(true); | |
587 DSurfaceRenderText(gs.begin(), gs.end(), Rect(0,0,gs.width(),gs.height()), surface, Rect(x,y+height)); | |
588 gs.SetReverse(false); | |
589 nptn = 2; | |
590 } else { | |
591 /* ¥é¥Ù¥ëÍѤΠSurface ¤òºî¤ë */ | |
592 char* box = create_box(width, height, _back.r, _back.g, _back.b); | |
593 surface = root.NewSurfaceFromRGBAData(width, height*3, box, ALPHA_MASK); | |
594 | |
595 Surface* text_surface = root.NewSurface(width, height, ALPHA_MASK); | |
596 DSurfaceFill(text_surface, Rect(*text_surface), 0, 0, 0, 0); | |
597 | |
598 gs.SetColor(_fore.r, _fore.g, _fore.b); | |
599 DSurfaceRenderText(gs.begin(), gs.end(), Rect(0,0,gs.width(),gs.height()), text_surface, Rect(x,y)); | |
600 root.BlitSurface(text_surface, Rect(0,0,width,height), surface, Rect(0,0)); | |
601 gs.SetColor(_pressed.r, _pressed.g, _pressed.b); | |
602 DSurfaceRenderText(gs.begin(), gs.end(), Rect(0,0,gs.width(),gs.height()), text_surface, Rect(x,y)); | |
603 root.BlitSurface(text_surface, Rect(0,0,width,height), surface, Rect(0,height)); | |
604 root.BlitSurface(text_surface, Rect(0,0,width,height), surface, Rect(0,height*2)); | |
605 root.DeleteSurface(text_surface); | |
606 } | |
607 | |
608 Pic()->SetSurface(surface, surf_x, surf_y); | |
609 show(); | |
610 } | |
611 | |
612 TextButton::~TextButton() { | |
613 if (surface) root.DeleteSurface(surface); | |
52 | 614 surface = NULL; |
0 | 615 } |
616 | |
617 Text::Text(Event::Container& container, PicContainer* parent, const Rect& r, const Rect& text_r, int _fontsize) : | |
618 Event::Video(container), | |
619 Event::Time(container), | |
620 event(container), | |
621 srcrect(0,0,0,0), | |
622 layout(wdefault_font.c_str(), _fontsize), fontsize(_fontsize) { | |
623 | |
624 SetPic(parent->create_node(r, 0)); | |
625 surface = parent->Root().NewSurface(text_r.width(), text_r.height(), ALPHA_MASK); | |
626 pictext = PicNode()->create_leaf(text_r, PicBase::CACHE_BACK); | |
627 pictext->SetSurface(surface, 0, 0); | |
628 pictext->show(); | |
629 cursor = 0; | |
630 cursor_activated = false; | |
631 window_activated = false; | |
632 | |
633 event.RegisterGlobalPressFunc(&Pressed, (void*)this); | |
634 | |
635 speed = 10; | |
636 wait_delay = -1; | |
637 status = PREPARE; | |
638 old_time = wait_starttime = 0; | |
639 } | |
640 | |
641 Text::~Text() { | |
642 event.DeleteGlobalPressFunc(&Pressed, (void*)this); | |
643 PicNode()->Root().DeleteSurface(surface); | |
644 } | |
645 | |
646 void Text::SetSpeed(int new_speed) { | |
647 speed = new_speed; | |
648 } | |
52 | 649 |
0 | 650 void Text::SetWait(int new_wait) { |
651 if (new_wait < 0) new_wait = 100000000; | |
652 wait_delay = new_wait; | |
653 } | |
654 | |
655 int Text::CalcScrollHeight(void) { | |
656 int i; | |
657 int len = bottom_pos.size(); | |
658 int y0 = bottom_pos[line_number]; | |
659 int height = Rect(*surface).height(); | |
660 for (i=line_number; i<len; i++) | |
661 if (bottom_pos[i] - y0 > height) break; | |
662 if (i == line_number) i = line_number + 1; | |
663 return i - line_number - 1; | |
664 } | |
52 | 665 |
0 | 666 void Text::Elapsed(unsigned int current_time) { |
667 SetWakeup(current_time + 50); | |
668 if (status == PREPARE) { | |
669 old_time = current_time; | |
670 return; | |
671 } | |
672 int nChar = speed * (current_time - old_time) / 1000; | |
673 if (speed == -1 || press_count) nChar = -1; | |
674 if (nChar == 0) return; | |
675 if (speed == -1) old_time = current_time; | |
676 else old_time += nChar * 1000 / speed; | |
677 | |
678 switch(status) { | |
679 case WAIT: goto label_wait; | |
680 case SCROLL: goto label_scroll; | |
681 case DRAW2: goto label_draw2; | |
682 case WAIT2: goto label_wait2; | |
683 } | |
684 | |
685 status = DRAW; | |
686 if (press_count) { | |
687 nChar = -1; | |
688 press_count = 0; | |
689 } | |
690 DrawText(nChar); | |
691 if (nChar == 0) return; | |
692 status = WAIT; | |
693 cursor_activated = true; | |
694 if (cursor_activated && window_activated && cursor) cursor->show(); | |
695 wait_starttime = current_time; | |
696 label_wait: | |
697 if (current_time < wait_starttime + wait_delay && press_count == 0) return; | |
698 press_count = 0; | |
699 nChar = 0; | |
700 cursor_activated = false; | |
701 if (cursor) cursor->hide(); | |
702 while(cur_pos != gstream.end()) { | |
703 // ¥¹¥¯¥í¡¼¥ë¤·¤Æ¤Ï¼¡¹ÔÉÁ²è¡¢¤ò·«¤êÊÖ¤¹ | |
704 for (scroll_height = CalcScrollHeight(); scroll_height > 0; scroll_height--) { | |
705 status = SCROLL; | |
706 label_scroll: | |
707 if (press_count) break; | |
708 Scrollup(nChar); | |
709 if (nChar == 0) return; | |
710 status = DRAW2; | |
711 label_draw2: | |
712 if (press_count) break; | |
713 DrawText(nChar); | |
714 if (nChar == 0) return; | |
715 } | |
716 if (nChar != 0 && scroll_height) { | |
717 nChar = 100000; | |
718 if (status == SCROLL) Scrollup(nChar); | |
719 DrawText(nChar); | |
720 scroll_height--; | |
721 for (; scroll_height > 0; scroll_height--) { | |
722 Scrollup(nChar); | |
723 DrawText(nChar); | |
724 } | |
725 } | |
726 press_count = 0; | |
727 status = WAIT2; | |
728 cursor_activated = true; | |
729 if (cursor_activated && window_activated && cursor) cursor->show(); | |
730 wait_starttime = current_time; | |
731 label_wait2: | |
732 if (current_time < wait_starttime + wait_delay && press_count == 0) return; | |
733 press_count = 0; | |
734 nChar = 0; | |
735 cursor_activated = false; | |
736 if (cursor) cursor->hide(); | |
737 } | |
738 status = PREPARE; | |
739 } | |
740 | |
741 bool Text::Pressed(int x, int y, void* pointer) { | |
742 Text* wid = (Text*)pointer; | |
743 if (wid->Pic()->IsHidden()) return true; | |
744 wid->press_count++; | |
745 return true; | |
746 } | |
747 | |
748 void Text::Clear(void) { | |
749 stream.container.clear(); | |
750 DSurfaceFill(surface, Rect(*surface), 0, 0, 0, 0); | |
751 pictext->ReBlit(); | |
752 status = PREPARE; | |
753 } | |
754 | |
755 void Text::Flush(void) { | |
756 int nChar = -1; | |
757 DrawText(nChar); | |
758 } | |
759 | |
760 void Text::Start(void) { | |
761 gstream.clear(); | |
762 bottom_pos.clear(); | |
763 layout.Layout(stream, gstream, bottom_pos, pictext->Width()-fontsize/2); | |
764 | |
765 // height ¤ÎÀÑ»»ÃͤȤ·¤Æ bottom_pos ¤ò·×»» | |
766 std::vector<int>::iterator it; | |
767 int pos = 0; | |
768 for (it = bottom_pos.begin(); it != bottom_pos.end(); it++) { | |
769 pos += *it; | |
770 *it = pos; | |
771 } | |
772 | |
773 cur_pos = gstream.begin(); | |
774 line_number = 0; | |
775 scrolled_count = 0; | |
776 srcrect = Rect(0, 0, pictext->Width(), pictext->Height()); | |
777 press_count = 0; | |
778 | |
779 status = DRAW; | |
780 cursor_activated = false; | |
781 if (cursor) cursor->hide(); | |
782 } | |
783 | |
784 void Text::DrawText(int& nChar) { | |
785 // ÉÁ²èÈϰϤòÆÀ¤ë | |
786 iterator end = gstream.end(); | |
787 iterator it = cur_pos; | |
788 while(nChar && it != end) { // nChar < 0 ¤Ê¤é½ÐÍè¤ë¤À¤±¤Îʸ»ú¤òÉÁ²è | |
789 if (! (it->flag & TextGlyph::Group)) nChar--; | |
790 if (it->flag & TextGlyph::LineEnd) { | |
791 if (bottom_pos[line_number+1] > srcrect.by) { //²þ¹Ô¤¹¤ë¤È²èÌ̤«¤é½Ð¤Æ¤·¤Þ¤¦ | |
792 it++; | |
793 if (nChar == 0) nChar = 1; | |
794 break; | |
795 } | |
796 line_number++; | |
797 } | |
798 it++; | |
799 } | |
800 // ÉÁ²è¤¹¤ë | |
801 Rect r = DSurfaceRenderText(cur_pos, it, srcrect, surface, Rect(0,0,0,0)); | |
802 pictext->ReBlit(r); | |
803 cur_pos = it; | |
804 } | |
805 | |
806 void Text::Scrollup(int& nChar) { | |
807 if (nChar < 0) { // °ì²èÌÌʬ¥¹¥¯¥í¡¼¥ë¤¹¤ë | |
808 DSurfaceFill(surface, Rect(*surface), 0, 0, 0, 0); | |
809 pictext->ReBlit(); | |
810 srcrect = Rect(*surface); | |
811 srcrect.rmove(0, bottom_pos[line_number]); | |
812 line_number++; | |
813 scrolled_count = 0; | |
814 return; | |
815 } | |
816 // ¥¹¥¯¥í¡¼¥ëÉý¤òµá¤á¤ë | |
817 const int max_scroll_count = 8; | |
818 int dy = bottom_pos[line_number+1] - bottom_pos[line_number]; | |
819 int cur_dy; | |
820 if (scrolled_count+nChar >= max_scroll_count) { | |
821 cur_dy = dy - (scrolled_count*dy/max_scroll_count); | |
822 nChar -= max_scroll_count-scrolled_count; | |
823 nChar++; | |
824 scrolled_count = 0; | |
825 line_number++; | |
826 srcrect.rmove(0, dy); | |
827 } else { | |
828 cur_dy = (scrolled_count+nChar)*dy/max_scroll_count; | |
829 cur_dy -=(scrolled_count*dy/max_scroll_count); | |
830 scrolled_count += nChar; | |
831 nChar = 0; | |
832 } | |
833 Rect r(*surface); | |
834 DSurfaceMove(surface, r, surface, Rect(0, -cur_dy, 0, 0)); | |
835 r.ty = r.by-cur_dy; | |
836 DSurfaceFill(surface, r, 0, 0, 0, 0); | |
837 pictext->ReBlit(); | |
838 } | |
839 | |
840 void Text::activate(void) { | |
841 event.RegisterGlobalPressFunc(&Pressed, (void*)this); | |
842 Event::Video::activate(); | |
843 window_activated = true; | |
844 if (cursor_activated && window_activated && cursor) cursor->show(); | |
845 } | |
52 | 846 |
0 | 847 void Text::deactivate(void) { |
848 event.DeleteGlobalPressFunc(&Pressed, (void*)this); | |
849 Event::Video::deactivate(); | |
850 window_activated = false; | |
851 if (cursor) cursor->hide(); | |
852 } | |
52 | 853 |
0 | 854 void Text::SetCursor(TimeCursor* c) { |
855 cursor = c; | |
856 if (c) { | |
857 if (cursor_activated && window_activated) c->show(); | |
858 else c->hide(); | |
859 } | |
860 } | |
861 | |
862 Label::Label(PicContainer* parent, const Rect& r_orig, bool _is_center, const char* text, int _text_size) : | |
863 is_center(_is_center), | |
864 root(parent->Root()), | |
865 text_size(_text_size) { | |
866 Rect r(r_orig); | |
867 | |
52 | 868 if (text == NULL) text = ""; |
869 int width = r.width(); | |
870 int height = r.height(); | |
0 | 871 if (width == 0) width = parent->Width() - r.lx; |
872 | |
873 TextGlyphStream gs = DefaultLayout(text_size)->Layout(text, width); | |
874 | |
875 if (r.width() == 0) { // ʸ»ú¤Ë¹ç¤ï¤»¤Æ¥¦¥£¥¸¥Ã¥ÈºîÀ® | |
876 width = gs.width(); | |
877 r.rx = r.lx + gs.width(); | |
878 } | |
879 if (r.height() == 0) { | |
880 r.by = r.ty + gs.height(); | |
881 } | |
882 | |
883 SetPic(parent->create_leaf(r, 0)); | |
884 | |
885 /* ¥é¥Ù¥ëÍѤΠSurface ¤òºî¤ë */ | |
886 surface = parent->Root().NewSurface(r.width(), r.height(), ALPHA_MASK); | |
887 | |
888 DSurfaceFill(surface, Rect(*surface), 0, 0, 0, 0); | |
889 int x = 0, y = 0; | |
890 if (is_center) { | |
891 x = (Pic()->Width() - gs.width()) / 2; | |
892 y = (Pic()->Height() - gs.height()) / 2; | |
893 } | |
894 | |
895 DSurfaceRenderText(gs.begin(), gs.end(), Rect(*surface), surface, Rect(x,y)); | |
896 | |
897 Pic()->SetSurface(surface, 0, 0); | |
898 show(); | |
899 } | |
52 | 900 |
0 | 901 Label::~Label() { |
902 root.DeleteSurface(surface); | |
903 } | |
52 | 904 |
0 | 905 void Label::SetText(const char* text) { |
52 | 906 if (text == NULL) text = ""; |
0 | 907 TextGlyphStream gs = DefaultLayout(text_size)->Layout(text, Pic()->Width()); |
908 DSurfaceFill(surface, Rect(*surface), 0, 0, 0, 0); | |
909 int x = 0, y = 0; | |
910 if (is_center) { | |
911 x = (Pic()->Width() - gs.width()) / 2; | |
912 y = (Pic()->Height() - gs.height()) / 2; | |
913 } | |
914 | |
915 DSurfaceRenderText(gs.begin(), gs.end(), Rect(*surface), surface, Rect(x,y)); | |
916 Pic()->ReBlit(); | |
917 } | |
918 | |
919 Dialog::Dialog(Event::Container& container, PicContainer* parent, const char* text, bool with_cancel) : | |
920 Event::Video(container) { | |
921 | |
922 int x,y; | |
923 status = WAIT; | |
52 | 924 set_func = NULL; |
925 set_pointer = NULL; | |
0 | 926 |
927 XKFont::HorizLayout& layout = *DefaultLayout(26); | |
928 int dialog_width = parent->Width() / 2; | |
929 TextGlyphStream s_ok = layout.Layout("£Ï£Ë", dialog_width); | |
930 TextGlyphStream s_cancel = layout.Layout("¼è¾Ã", dialog_width); | |
931 TextGlyphStream s_text = layout.Layout(text, dialog_width); | |
932 | |
933 Rect r_text(0, 0, s_text.width(), s_text.height()); | |
934 Rect r_ok(0, 0, s_ok.width(), s_ok.height()); | |
935 Rect r_cancel(0, 0, s_cancel.width(), s_cancel.height()); | |
936 | |
937 /* ¥À¥¤¥¢¥í¥°¥Ü¥Ã¥¯¥¹¤Î Surface ¤òºî¤ë */ | |
938 int dwidth = r_text.width() + (r_text.width()/10)*2 + 6; | |
939 int dheight = r_text.height() + r_ok.height() + r_cancel.height()*3 + 4; | |
940 surface_diag = parent->Root().NewSurface(dwidth, dheight, NO_MASK); // alpha ¤Ê¤· | |
941 DSurfaceFill(surface_diag, Rect(*surface_diag), 0xf0, 0xd0, 0xa0); | |
942 DrawBox(surface_diag, Rect(0,0,dwidth,dheight)); | |
943 | |
944 Surface* surface_text = parent->Root().NewSurface(r_text.width(), r_text.height(), ALPHA_MASK); | |
945 s_text.SetColor(0x38, 0x20, 0x18); | |
946 DSurfaceRenderText(s_text.begin(), s_text.end(), r_text, surface_text, Rect(0, 0, 0, 0)); | |
947 x = r_text.width()/10 + 3; | |
948 y = r_cancel.height()+2; | |
949 parent->Root().BlitSurface(surface_text, r_text, surface_diag, Rect(x, y, x+r_text.width(), y+r_text.height())); | |
950 parent->Root().DeleteSurface(surface_text); | |
951 | |
952 /* panel ¤ò¤Ä¤¯¤ë */ | |
953 x = (parent->Width()-dwidth)/2; | |
954 y = (parent->Height()-dheight)/2; | |
955 SetPic(parent->create_node(Rect(x, y, x+dwidth, y+dheight), 0)); | |
956 | |
957 /* ¥Ü¥¿¥ó¤òºîÀ®¤¹¤ë */ | |
958 /* f8d8c8 ÇØ·Ê(ÌÀ)*/ | |
959 /* f0d0a0 ÇØ·Ê*/ | |
960 /* b08040 ÏÈ¡ÊÌÀ)*/ | |
961 /* 805010 ÏÈ*/ | |
962 /* 382018 ¹õ*/ | |
963 /* 9890f8 ÀÄ*/ | |
964 /* dc6448 ÀÖ*/ | |
965 /* ³Æ¥Ü¥¿¥ó¤Ïº¸±¦¤Ë¥Ü¥¿¥óÉý¤Î 1/4, ¾å²¼¤Ë¥Ü¥¿¥óÉý¤Î 1/4 ¤Î¥Þ¡¼¥¸¥ó¤ò»ý¤Ä */ | |
966 Rect r_btn(r_ok); r_btn.join(r_cancel); | |
967 int btn_width = r_btn.width() * 3 / 2; | |
968 int btn_height = r_btn.height() * 3 / 2; | |
969 surface_btn = parent->Root().NewSurface(btn_width, btn_height*4, ALPHA_MASK); | |
970 DSurfaceFill(surface_btn, Rect(*surface_btn), 0, 0, 0, 0); | |
971 s_ok.SetColor(0x38, 0x20, 0x18); | |
972 DSurfaceRenderText(s_ok.begin(), s_ok.end(), r_ok, surface_btn, Rect( (btn_width-r_ok.width())/2,(btn_height-r_ok.height())/2)); | |
973 s_ok.SetColor(0x98, 0x90, 0xf8); | |
974 DSurfaceRenderText(s_ok.begin(), s_ok.end(), r_ok, surface_btn, Rect( (btn_width-r_ok.width())/2,(btn_height-r_ok.height())/2 + btn_height)); | |
975 s_cancel.SetColor(0x38, 0x20, 0x18); | |
976 DSurfaceRenderText(s_cancel.begin(), s_cancel.end(), r_cancel, surface_btn, Rect( (btn_width-r_cancel.width())/2,(btn_height-r_cancel.height())/2 + btn_height*2)); | |
977 s_cancel.SetColor(0xdc, 0x64, 0x48); | |
978 DSurfaceRenderText(s_cancel.begin(), s_cancel.end(), r_cancel, surface_btn, Rect( (btn_width-r_cancel.width())/2,(btn_height-r_cancel.height())/2 + btn_height*3)); | |
979 | |
980 x = (dwidth - btn_width*2) / 3;; | |
981 y = r_cancel.height()*3/2 + r_text.height() + 2; | |
982 if (!with_cancel) x = (dwidth - btn_width) / 2; | |
983 Button* b_ok = new Button(container, PicNode(), surface_btn, 0, 0, 0, btn_height, 2, Rect(x, y, x+btn_width, y+btn_height), 1); | |
984 DrawBox(surface_diag, Rect(x-3,y-2,x+btn_width+3,y+btn_height+2)); | |
985 b_ok->press_pointer = (void*)this; | |
986 b_ok->press_func = &press_ok; | |
987 if (with_cancel) { | |
988 x += x + btn_width; | |
989 Button* b_cancel = new Button(container, PicNode(), surface_btn, 0, btn_height*2, 0, btn_height, 2, Rect(x, y, x+btn_width, y+btn_height), 1); | |
990 DrawBox(surface_diag, Rect(x-3,y-2,x+btn_width+3,y+btn_height+2)); | |
991 b_cancel->press_pointer = (void*)this; | |
992 b_cancel->press_func = &press_cancel; | |
993 } | |
994 | |
995 Pic()->SetSurface(surface_diag, 0, 0); | |
996 Pic()->ZMove(ZMOVE_TOP); | |
997 | |
998 show_all(); | |
999 } | |
52 | 1000 |
0 | 1001 Dialog::~Dialog() { |
1002 PicRoot& root = PicNode()->Root(); | |
52 | 1003 SetPic(NULL); |
0 | 1004 root.DeleteSurface(surface_btn); |
1005 root.DeleteSurface(surface_diag); | |
1006 } | |
1007 | |
1008 void Dialog::press_ok(void* pointer, Button* btn) { | |
1009 if (pointer) { | |
1010 Dialog* wid = (Dialog*)pointer; | |
1011 wid->status = OK; | |
1012 if (wid->set_func) { | |
1013 (*wid->set_func)(wid->set_pointer, wid); | |
1014 } | |
1015 } | |
1016 } | |
52 | 1017 |
0 | 1018 void Dialog::press_cancel(void* pointer, Button* btn) { |
1019 if (pointer) { | |
1020 Dialog* wid = (Dialog*)pointer; | |
1021 wid->status = CANCEL; | |
1022 if (wid->set_func) { | |
1023 (*wid->set_func)(wid->set_pointer, wid); | |
1024 } | |
1025 } | |
1026 } | |
1027 | |
1028 void Dialog::DrawBox(Surface* s, const Rect& r) { | |
1029 DSurfaceFill(s, Rect(r.lx, r.ty, r.rx, r.ty+1), 0x80, 0x50, 0x10); | |
1030 DSurfaceFill(s, Rect(r.lx, r.ty+1, r.rx, r.ty+2), 0x38, 0x20, 0x18); | |
1031 DSurfaceFill(s, Rect(r.lx, r.by-2, r.rx, r.by-1), 0x80, 0x50, 0x10); | |
1032 DSurfaceFill(s, Rect(r.lx, r.by-1, r.rx, r.by), 0x38, 0x20, 0x18); | |
1033 | |
1034 DSurfaceFill(s, Rect(r.lx, r.ty, r.lx+1, r.by), 0xb0, 0x80, 0x40); | |
1035 DSurfaceFill(s, Rect(r.lx+1, r.ty+1, r.lx+2, r.by-1), 0x80, 0x50, 0x10); | |
1036 DSurfaceFill(s, Rect(r.lx+1, r.ty+2, r.lx+2, r.by-2), 0x38, 0x20, 0x18); | |
1037 DSurfaceFill(s, Rect(r.rx-3, r.ty+2, r.rx-2, r.by-2), 0xb0, 0x80, 0x40); | |
1038 DSurfaceFill(s, Rect(r.rx-2, r.ty+1, r.rx-1, r.by-1), 0x80, 0x50, 0x10); | |
1039 DSurfaceFill(s, Rect(r.rx-1, r.ty, r.rx, r.by), 0x38, 0x20, 0x18); | |
1040 } | |
1041 | |
1042 AnmTime::AnmTime(Event::Container& container, PicBase* _pic, int _total_time, int _all_count) : | |
1043 Event::Time(container), | |
1044 PicAnm(_pic), start_time(0), total_time(_total_time), all_count(_all_count) { | |
1045 status = FINISHED; | |
1046 if (total_time == 0) total_time = 1; | |
1047 } | |
52 | 1048 |
0 | 1049 AnmTime::AnmTime(Event::Container& container, std::vector<PicBase*> _pic, int _total_time, int _all_count) : |
1050 Event::Time(container), | |
1051 PicAnm(_pic), start_time(0), total_time(_total_time), all_count(_all_count) { | |
1052 status = FINISHED; | |
1053 if (total_time == 0) total_time = 1; | |
1054 } | |
52 | 1055 |
0 | 1056 void AnmTime::Elapsed(unsigned int current_time) { |
1057 if (total_time == 0) return; | |
1058 if (status == FINISHED || current_time == 0) {SetWakeup(current_time+1); return;} | |
1059 if (start_time == 0) { | |
1060 start_time = current_time; | |
1061 Start(); | |
1062 } | |
1063 unsigned int time_elapsed = current_time - start_time; | |
1064 if (time_elapsed < total_time) { | |
1065 int count = time_elapsed * all_count / total_time; | |
1066 Exec(count); | |
1067 int next_time = start_time + (count+1) * total_time / all_count; | |
1068 SetWakeup(next_time); | |
1069 } else { | |
1070 Exec(all_count); | |
1071 Finish(); | |
1072 status = FINISHED; | |
1073 } | |
1074 } | |
52 | 1075 |
0 | 1076 void AnmTime::Abort(void) { |
1077 if (status == FINISHED) return; | |
1078 if (start_time == 0) { | |
1079 Start(); | |
1080 Exec(all_count); | |
1081 } | |
1082 if (total_time) { | |
1083 Finish(); | |
1084 } | |
1085 status = FINISHED; | |
1086 } | |
52 | 1087 |
0 | 1088 bool AnmTime::IsEnd(void) { |
1089 return status == FINISHED; | |
1090 } | |
52 | 1091 |
0 | 1092 AnmMove::AnmMove(Event::Container& container, PicBase* _pic, const Rect& _to, int total_time) : |
1093 AnmTime(container, _pic, total_time), | |
1094 from(0,0), to(_to) { | |
1095 from.lx = _pic->PosX(); | |
1096 from.ty = _pic->PosY(); | |
1097 from.rx = from.lx + _pic->Width(); | |
1098 from.by = from.ty + _pic->Height(); | |
1099 | |
1100 int dx = to.lx - from.lx; | |
1101 int dy = to.ty - from.ty; | |
1102 if (dx < 0) dx = -dx; | |
1103 if (dy < 0) dy = -dy; | |
1104 if (dx < dy) dx = dy; | |
1105 if (dx == 0) dx = 1; | |
1106 SetAllCount(dx); | |
1107 } | |
52 | 1108 |
0 | 1109 void AnmMove::Exec(int count) { |
1110 Rect r(from); | |
1111 int dx = to.lx - from.lx; | |
1112 int dy = to.ty - from.ty; | |
1113 r.rmove(dx*count/all_count, dy*count/all_count); | |
1114 iterator it; | |
52 | 1115 for (it=pic.begin(); it!=pic.end(); it++) |
1116 (*it)->Move(r.lx, r.ty); | |
0 | 1117 } |
52 | 1118 |
0 | 1119 AnmAlpha::AnmAlpha(Event::Container& container, PicBase* _pic, int alpha_from, int alpha_to, int total_time) : |
1120 AnmTime(container, _pic, total_time), | |
1121 from(alpha_from), to(alpha_to), alpha_r(0,0,1,1) { | |
1122 if (from < 0) from = 0; | |
1123 if (from >= ALPHA_MAX) from = ALPHA_MAX; | |
1124 if (to < 0) to = 0; | |
1125 if (to >= ALPHA_MAX) to = ALPHA_MAX; | |
1126 int c = from - to; | |
1127 if (c < 0) c = -c; | |
1128 if (c == 0) c = 1; | |
1129 SetAllCount(c); | |
1130 } | |
52 | 1131 |
0 | 1132 AnmAlpha::AnmAlpha(Event::Container& container, std::vector<PicBase*> _pic, int alpha_from, int alpha_to, int total_time) : |
1133 AnmTime(container, _pic, total_time), | |
1134 from(alpha_from), to(alpha_to), alpha_r(0,0,1,1) { | |
1135 if (from < 0) from = 0; | |
1136 if (from >= ALPHA_MAX) from = ALPHA_MAX; | |
1137 if (to < 0) to = 0; | |
1138 if (to >= ALPHA_MAX) to = ALPHA_MAX; | |
1139 int c = from - to; | |
1140 if (c < 0) c = -c; | |
1141 if (c == 0) c = 1; | |
1142 SetAllCount(c); | |
1143 } | |
52 | 1144 |
0 | 1145 void AnmAlpha::Start(void) { |
1146 iterator it; | |
52 | 1147 for (it=pic.begin(); it!=pic.end(); it++) |
1148 (*it)->show(); | |
0 | 1149 } |
52 | 1150 |
0 | 1151 void AnmAlpha::Exec(int count) { |
1152 alpha = (from * (all_count-count) + (to-from) * count) / all_count; | |
1153 iterator it; | |
52 | 1154 for (it=pic.begin(); it!=pic.end(); it++) |
1155 (*it)->SetSurfaceAlpha(&alpha, alpha_r); | |
0 | 1156 } |
52 | 1157 |
0 | 1158 void AnmAlpha::Finish(void) { |
1159 iterator it; | |
1160 for (it=pic.begin(); it!=pic.end(); it++) { | |
1161 if (to == 0) (*it)->hide(); | |
1162 else if (to != ALPHA_MAX) fprintf(stderr,"Warning in AnmAlpha::Finish: alpha value suddenly changed.\n"); | |
1163 (*it)->SetSurfaceAlpha(0,Rect(0,0)); | |
1164 } | |
1165 } | |
52 | 1166 |
0 | 1167 AnmAlphaMove::AnmAlphaMove(Event::Container& container, PicBase* _pic) : |
1168 AnmTime(container, _pic, 0) { | |
1169 } | |
52 | 1170 |
0 | 1171 void AnmAlphaMove::SetPtn(void) { |
1172 int total = 0; | |
1173 std::vector<Ptn>::iterator it; | |
1174 for (it=ptns.begin(); it!=ptns.end(); it++) { | |
1175 if (total < it->next_tick) total = it->next_tick; | |
1176 } | |
1177 SetAllCount(total); | |
1178 SetTotalTime(total); | |
1179 cur_count = 0; | |
1180 } | |
52 | 1181 |
0 | 1182 void AnmAlphaMove::Exec(int count) { |
1183 if (ptns.empty()) return; | |
1184 if (cur_count != 0 && ptns[cur_count].next_tick > count) return; | |
1185 if (cur_count >= ptns.size()) return; | |
1186 // ¼¡¤Î¥Ñ¥¿¡¼¥ó¤òõ¤¹ | |
1187 // count <= it->next_tick ¤Ê¤ë¾ò·ï¤òËþ¤¿¤¹ºÇ¸å¤Î it ¤òõ¤¹ | |
1188 std::vector<Ptn>::iterator it; | |
1189 for (it=ptns.begin()+cur_count; it != ptns.end(); it++) { | |
1190 if (count <= it->next_tick) break; | |
1191 } | |
1192 if (it == ptns.end()) { | |
1193 fprintf(stderr,"end\n"); | |
1194 it = ptns.end() - 1; | |
1195 } | |
1196 cur_count = it - ptns.begin(); | |
1197 | |
1198 iterator p; | |
1199 for (p=pic.begin(); p!=pic.end(); p++) { | |
1200 // move | |
1201 (*p)->Move(it->pos.lx, it->pos.ty); | |
1202 (*p)->SetSurfacePos(it->surface_pos.lx, it->surface_pos.ty); | |
1203 // alpha set | |
1204 if (it->alpha == 0) (*p)->hide(); | |
1205 else if (it->alpha == ALPHA_MAX) { (*p)->show(); (*p)->SetSurfaceAlpha(0, Rect(0,0)); } | |
1206 else { (*p)->show(); (*p)->SetSurfaceAlpha( &(it->alpha), Rect(0,0,1,1)); } | |
1207 } | |
1208 } | |
52 | 1209 |
0 | 1210 void AnmAlphaMove::Finish(void) { |
1211 if (ptns.empty()) return; | |
1212 if (cur_count >= ptns.size() - 1) return; | |
1213 cur_count = ptns.size() - 1; | |
1214 Exec(ptns[cur_count].next_tick); // ºÇ¸å¤Î pattern ¤Î¾õÂ֤ˤ¹¤ë | |
1215 } | |
1216 | |
1217 AnmPtnSolid::AnmPtnSolid(Event::Container& container, PicBase* _pic, const unsigned char* _ptn, const Rect& _alpha_r, int total_time) : | |
1218 AnmTime(container, _pic, total_time), | |
1219 ptn(_ptn), alpha_r(_alpha_r) | |
1220 { | |
1221 ptn_len = alpha_r.width() * alpha_r.height(); | |
1222 alpha = new unsigned char[ptn_len]; | |
1223 int max_a = 0; | |
1224 for (int i=0; i<ptn_len; i++) { | |
1225 if (ptn[i] > max_a) max_a = ptn[i]; | |
1226 } | |
1227 if (max_a == 0) max_a = 1; | |
1228 SetAllCount(max_a); | |
1229 } | |
1230 | |
1231 AnmPtnAlpha::AnmPtnAlpha(Event::Container& container, PicBase* _pic, const unsigned char* _ptn, const Rect& _alpha_r, int _band_width, int total_time) : | |
1232 AnmTime(container, _pic, total_time), | |
1233 ptn(_ptn), band(_band_width), alpha_r(_alpha_r) | |
1234 { | |
1235 ptn_len = alpha_r.width() * alpha_r.height(); | |
1236 alpha = new unsigned char[ptn_len]; | |
1237 if (band <= 0) band = 1; | |
1238 SetAllCount(ALPHA_MAX+band); | |
1239 } | |
1240 | |
1241 void AnmPtnSolid::Exec(int count) { | |
1242 int i; | |
1243 for (i=0; i<ptn_len; i++) { | |
1244 if (ptn[i] <= count) alpha[i] = ALPHA_MAX; | |
1245 else alpha[i] = 0; | |
1246 } | |
1247 iterator it; | |
52 | 1248 for (it=pic.begin(); it!=pic.end(); it++) |
1249 (*it)->SetSurfaceAlpha(alpha, alpha_r); | |
0 | 1250 } |
52 | 1251 |
0 | 1252 void AnmPtnAlpha::Exec(int count) { |
1253 int i; | |
1254 int ptn_zero = count; | |
1255 int ptn_max = count - band; | |
1256 for (i=0; i<ptn_len; i++) { | |
1257 if (ptn[i] >= ptn_zero) alpha[i] = 0; | |
1258 else if (ptn[i] < ptn_max) alpha[i] = ALPHA_MAX; | |
1259 else alpha[i] = (ptn_zero-ptn[i])*ALPHA_MAX/band; | |
1260 } | |
1261 iterator it; | |
1262 for (it=pic.begin(); it!=pic.end(); it++) (*it)->SetSurfaceAlpha(alpha, alpha_r); | |
1263 } | |
1264 | |
1265 void AnmPtnSolid::Start(void) { | |
1266 iterator it; | |
52 | 1267 for (it=pic.begin(); it!=pic.end(); it++) |
1268 (*it)->show(); | |
0 | 1269 } |
52 | 1270 |
0 | 1271 void AnmPtnSolid::Finish(void) { |
1272 iterator it; | |
52 | 1273 for (it=pic.begin(); it!=pic.end(); it++) |
1274 (*it)->SetSurfaceAlpha(0, Rect(0,0)); | |
0 | 1275 } |
52 | 1276 |
0 | 1277 void AnmPtnAlpha::Start(void) { |
1278 iterator it; | |
52 | 1279 for (it=pic.begin(); it!=pic.end(); it++) |
1280 (*it)->show(); | |
0 | 1281 } |
52 | 1282 |
0 | 1283 void AnmPtnAlpha::Finish(void) { |
1284 iterator it; | |
1285 for (it=pic.begin(); it!=pic.end(); it++) (*it)->SetSurfaceAlpha(0, Rect(0,0)); | |
1286 } | |
1287 | |
1288 /* | |
1289 | |
1290 Widget ¤Î¼ïÎà | |
1291 Mouse: ¥Þ¥¦¥¹°ÌÃÖ¤ËϢư¤¹¤ë¡£Surface ¤È origin ¤¬É¬¿Ü | |
1292 Panel : ¤Ê¤Ë¤â¸ºß¤·¤Ê¤¤¤È¤³¤í¤ËÄ¥¤ê¤Ä¤±¤Æ¤¤¤¯ | |
1293 ÇØ·ÊÄ¥¤ê¤Ä¤±¤â²Äǽ | |
1294 ButtonPanel : ̵¸ú²½²Äǽ¡£Group ¤Î Button ¤¬¥«¡¼¥½¥ë¤ËÆþ¤Ã¤¿¤é¡¢Á´Button / Label ¤¬¡Ö¥«¡¼¥½¥ë²¼¡×¾õÂ֤ˤʤë | |
1295 Ʊ°ìÊÑ¿ô¤ò°·¤¦¥Ü¥¿¥ó¤Ï¸¶Â§¡¢Æ±°ìButtonPanel ¤Î²¼¤ËÆþ¤ë¤³¤È¡ÊƱ´ü¤¹¤ë¡£¹â®²½²Äǽ¡Ë | |
1296 ¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢¥Ü¥¿¥ó¤Î GlobalVariable ¥Õ¥é¥°¤òΩ¤Æ¤ëɬÍפ¬¤¢¤ë | |
1297 ÇطʼïÎࡧWindow | |
1298 ÆâÉô¤ÎÆ©ÌÀÅÙ¤ÈÏÈ·Á¤òÊÌ¡¹¤Ë»ØÄê²Äǽ¡£ÏÈ·Á¤ÏÁ´ÏÈ¡¢ÉôʬÏȤɤÁ¤é¤Î·Á¤Ç¤â²Äǽ | |
1299 ¡ÊÉôʬÏȤʤ顢ÆâÉôŪ¤Ë¤Ï¾åÏÈ¡¢²¼ÏÈ¡¢º¸±¦ÏȤÈÊÌ Surface ¤Ç´ÉÍý¤¹¤ë¡Ë | |
1300 DragButton | |
1301 Panel Á´ÂΤò¥É¥é¥Ã¥°¤·¡¢¾ì½êÊѹ¹¤Ç¤¤ë¥Ü¥¿¥ó¡£ | |
1302 Button: ̵¸ú²½¡äÄ̾ï¡ä¥«¡¼¥½¥ë²¼¡ä¥Ü¥¿¥ó²¡²¼ ¤Îpicture / animation | |
1303 Toggle Button ¤Ë¤Ç¤¤ë(Group²½¤¹¤ì¤ÐRadioButton¤Ë¤â¤Ç¤¤ë) | |
1304 Label : ̵¸ú²½¡äÄ̾ï¡ä¥«¡¼¥½¥ë²¼¡¡¤Îanimation | |
1305 animation ¤Ï | |
1306 ¡¦¾å¤Ø¤ÎÊѲ½ | |
1307 ¡¦²¼¤Ø¤ÎÊѲ½ | |
1308 ¡¦¾ï»þÊÑ·Á | |
1309 ¤Î£³¤Ä¤Î·Á¼°¤ò¤â¤Ä¡£ | |
1310 ·Á¼°¤Ï | |
1311 ¡¦x / y increment ¤Ë¤è¤ë¡ÊÁ´Îΰè¤È x,y ¤ÎÂ礤µ¤ò»ØÄꤹ¤ë¤Èº¸¾å¤«¤é±¦¾å¡¢º¸²¼¡¢¤È¤¤¤¦Êý¤Ø¾¡¼ê¤ËÎΰè¤òÊѹ¹¤·¤Æ¤¤¤¯¡Ë | |
1312 ¡¦¿§ÊѲ½¡ÊÌÀÅÙÊѲ½¡Ë¡£¿§¥Æ¡¼¥Ö¥ë¤ò»ØÄꤹ¤ë¡£Surface ¤Ï alpha ¤Î¤ß¤È¤¹¤ë | |
1313 ¤É¤Á¤é¤â¡¢°ì¤Ä¤Î¥é¥Ù¥ë¤Ë»È¤¦»þ´Ö¤ÎŤµ¤ò»ØÄꤹ¤ë | |
1314 ¡¦callback ¤Ë¤è¤ë¡£»ØÄꤷ¤¿°ìÄê»þ´Ö°Ê¾å¤¬Î©¤Ä¤ÈCallBack ¤¬¸Æ¤Ó½Ð¤µ¤ì¡¢¿·¤¿¤ÊSurface , origin ¤ò»ØÄꤹ¤ë¡£ | |
1315 | |
1316 ¡¦Surface ¤Ï | |
1317 ÉáÄ̤βèÁü | |
1318 ʸ»úÎó¡ÊŬÅö¤Ë²¾ÁÛ²½¡Ë | |
1319 ²èÁü¿ôÃÍÎó | |
1320 ¤Î¤¤¤º¤ì¤« | |
1321 Cursor | |
1322 ¥ê¥¿¡¼¥ó¥«¡¼¥½¥ë¡£Label ¤Î°ì¼ï¡£ | |
1323 Number | |
1324 ¿ô»ú¤òɽ¼¨¤¹¤ë¡£¥Õ¥©¥ó¥È¤ÎÂ礤µ¡¢¤â¤·¤¯¤Ï²èÁü¿ôÃÍÎó | |
1325 Text | |
1326 ¥Æ¥¥¹¥È¤òɽ¼¨¤¹¤ë | |
1327 ¥Ñ¥Í¥ë¤ÎÂ礤µ¤À¤±»ØÄꤹ¤ë¤ÈŬÅö¤Ë¤ä¤Ã¤Æ¤¯¤ì¤ë | |
1328 ¥«¡¼¥½¥ë¤Î°ÌÃÖ¡Êʸ»ú¤Î¼¡/ºÇ½ª¡Ë¤ò»ØÄꤹ¤ë¤³¤È | |
1329 µ¡Ç½¡§Ê¸»úÁ÷¤ê®ÅÙÀßÄê¡¢ÆɤßÈô¤Ð¤·ÀßÄê¡Ê¾ï¤ËºÇ¹â®¤Ç²¡¤·¤Ã¤Ñ¤Ê¤·¡Ë | |
1330 ProgressBar ¤Ê¤É | |
1331 ¥Ð¡¼¤ÎŤµ¡¢¤¢¤ë¤¤¤Ï°ÌÃÖ¤ÇÊÑ¿ô¤ÎÂ礤µ¤ò¼¨¤¹¡£ | |
1332 Tick, Max ¤ò»ØÄê¡¢ÊÑ¿ô¤ÎÊѲ½¤Ë¤ÏŬÅö¤ËÂбþ¤Ç¤¤ë¤è¤¦¤Ë¤¹¤ë | |
1333 ¥Ð¡¼¤ÎÊý¸þ¤È¤·¤Æ½Ä/²£¡£Surface ¤Ï·«¤êÊÖ¤·¤Ç»È¤¦¡Ê®Åپ塢32pixel ¤¯¤é¤¤¤¢¤Ã¤¿¤Û¤¦¤¬¤¤¤¤¤«¤â¡©¡Ë | |
1334 ¥Ð¡¼¤ÎÂå¤ï¤ê¤Ë¥Ü¥¿¥ó¤â»È¤¨¤ë¡£Surface »ØÄê¤Î¥á¥½¥Ã¥É¤¬°ã¤¦¤À¤±¡£ | |
1335 ¥ª¥×¥·¥ç¥ó¡§¥Ð¡¼¤Î¤É¤³¤«¤ò¥¯¥ê¥Ã¥¯¤µ¤ì¤¿¤È¤¡¢¤½¤³¤Ë°ÜÆ°¤¹¤ë¤«¤½¤³¤Ë¸þ¤«¤Ã¤Æ°ÜÆ°¤¹¤ë¤« | |
1336 ¥ª¥×¥·¥ç¥ó¡©¡§Ìð°õ¥Ü¥¿¥ó¡Ê¤¤¤é¤Ê¤¤¤«¡Ë | |
1337 ScrollBar | |
1338 ²£/½Ä¡£Panel ¤ÈϢư¤¹¤ë(ÀìÍÑ, ProgressBar ¤Î°ì¼ï¤È¤·¤Æ¼ÂÁõ) | |
1339 (Panel ¦¤Ç¡Ö¸«¤¨¤Ê¤¤Éôʬ¤Ïdelete, ¸«¤¨¤ëÉôʬ¤Ï¼«Æ°¤ÇºîÀ®¡×µ¡Ç½¤ò¤Ä¤±¤ë¡©¡§¥Ð¥Ã¥¯¥í¥°¡Ë | |
1340 | |
1341 | |
1342 | |
1343 ¥á¥Ë¥å¡¼¤Î½Ð¤·Êý | |
1344 ±¦¥¯¥ê¥Ã¥¯ | |
1345 ¥Ü¥¿¥ó¤ò²¡¤¹ | |
1346 ¾å¤ÎÊý¡¢±¦¤ÎÊý¤Ê¤ÉÎΰè¤Ë¹Ô¤¯¤È¥Ì¤Ã¤È½Ð¤Æ¤¯¤ë | |
1347 ¥á¥Ë¥å¡¼¥â¡¼¥ÉÆâ | |
1348 ¥Ü¥¿¥ó¤ò²¡¤·¤Æ½ªÎ» | |
1349 ¥Þ¥Ã¥×¤òºî¤Ã¤Æ¤ª¤¡¢³Æ¥á¥Ë¥å¡¼¤Ë̾Á°¤ò³ä¤ê¿¶¤ë¤ÈÆ󼡸µ¤Ë¹¤¬¤Ã¤¿¥á¥Ë¥å¡¼¤Ë¤Ê¤ë | |
1350 ̾Á°¤ò³ä¤ê¿¶¤ë¤È¾å¤Ë̾Á°¥ê¥¹¥È¤¬¤Ç¤Æ¤¯¤ë | |
1351 ̾Á°¤ò³ä¤ê¿¶¤ë¤È²£¤Ë̾Á°¥ê¥¹¥È¤¬½Ð¤Æ¤¯¤ë | |
1352 | |
1353 */ | |
1354 // } |