eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_scroll_bar.c
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * Copyright 2014 by Petr Gargulak. eGUI Community.
4 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License Version 3
9 * or later (the "LGPL").
10 *
11 * As a special exception, the copyright holders of the eGUI project give you
12 * permission to link the eGUI sources with independent modules to produce an
13 * executable, regardless of the license terms of these independent modules,
14 * and to copy and distribute the resulting executable under terms of your
15 * choice, provided that you also meet, for each linked independent module,
16 * the terms and conditions of the license of that module.
17 * An independent module is a module which is not derived from or based
18 * on this library.
19 * If you modify the eGUI sources, you may extend this exception
20 * to your version of the eGUI sources, but you are not obligated
21 * to do so. If you do not wish to do so, delete this
22 * exception statement from your version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * You should have received a copy of the GNU General Public License
29 * and the GNU Lesser General Public License along with this program.
30 * If not, see <http://www.gnu.org/licenses/>.
31 *
32 ***************************************************************************/
46 #include "d4d.h"
48 
49 
50 // Internal API
51 static void D4D_ScrlBrOnMessage(D4D_MESSAGE* pMsg);
52 static void D4D_ScrlBrOnKeyDown(D4D_MESSAGE* pMsg);
53 
54 #if defined(D4D_LLD_TCH) || defined(D4D_LLD_MOUSE)
55  static void D4D_ScrlBrOnTouch(D4D_MESSAGE* pMsg, D4D_POINT* point);
56 #endif
57 static void D4D_ScrlBrDrawArrow(D4D_POINT* ppt, D4D_COOR size, D4D_DIRECTION dir, D4D_COLOR color);
58 
59 
60 
62 {
63  D4D_DEFSTR("Scroll Bar"),
65  NULL,
66  NULL
67 };
68 
69 typedef struct
70 {
71  D4D_POINT position;
72  D4D_GEOMETRY contentGeom;
73  D4D_POINT scrollPos;
74  D4D_SIZE scrollSize;
75  D4D_POINT refreshPos;
76  D4D_SIZE refreshSize;
77  D4D_COOR scrollRadius;
78 } D4D_SCRLBAR_TMP_VAL;
79 
80 #define _calc (*((D4D_SCRLBAR_TMP_VAL*)d4d_scratchPad))
81 //static D4D_SCRLBAR_TMP_VAL _calc;
82 
83 static void D4D_ScrlBrValue2Coor(D4D_OBJECT* pThis)
84 {
85  D4D_SCROLL_BAR* pScrlBr = D4D_GET_SCROLL_BAR(pThis);
86  D4D_SCRLBAR_DATA* pData = pScrlBr->pData;
87 
88  _calc.position = D4D_GetClientToScreenPoint(pThis, &pThis->position);
89  D4D_ComputeGeometry(&(_calc.contentGeom), pThis);
90 
91 
92  _calc.scrollRadius = pThis->radius;
93 
94 
95  if(pThis->size.cx > pThis->size.cy)
96  {
97  // horizontal scroll bar
98  _calc.refreshPos = _calc.contentGeom.pnt;
99  _calc.refreshPos.x += (D4D_COOR)(_calc.contentGeom.sz.cy + 1);
100  //_calc.refreshPos.y++;
101 
102  _calc.refreshSize = _calc.contentGeom.sz;
103  _calc.refreshSize.cx -= (D4D_COOR)((_calc.contentGeom.sz.cy * 2) + 2);
104  //_calc.refreshSize.cy -= 2;
105 
106  _calc.scrollSize = _calc.refreshSize;
107 
108 
109  _calc.scrollSize.cy -= 2;
110 
111  _calc.scrollSize.cx = (D4D_COOR)D4D_MulDivUU16(_calc.refreshSize.cx, (Word)pData->page, (Word)(pData->maximum - pData->minimum));
112 
113  if(_calc.scrollSize.cx < D4D_SCRLBAR_MIN_TAB_SIZE)
114  _calc.scrollSize.cx = D4D_SCRLBAR_MIN_TAB_SIZE;
115 
116  _calc.scrollPos = _calc.refreshPos;
117  if(pData->maximum - pData->page - pData->minimum)
118  _calc.scrollPos.x += (D4D_COOR)(D4D_MulDivUU16((Word)(_calc.refreshSize.cx - _calc.scrollSize.cx - 1), (Word)pData->position, (Word)(pData->maximum - pData->page - pData->minimum)) + 1);
119  _calc.scrollPos.y++;
120 
121 
122  }else
123  {
124  // vertical scroll bar
125  _calc.refreshPos = _calc.contentGeom.pnt;
126  _calc.refreshPos.y += (D4D_COOR)(_calc.contentGeom.sz.cx + 1);
127  // _calc.refreshPos.x++;
128 
129  _calc.refreshSize = _calc.contentGeom.sz;
130  //_calc.refreshSize.cx -= 2;
131  _calc.refreshSize.cy -= (D4D_COOR)((_calc.contentGeom.sz.cx * 2) + 2);
132 
133  _calc.scrollSize = _calc.refreshSize;
134 
135  _calc.scrollSize.cx -= 2;
136 
137  _calc.scrollSize.cy = (D4D_COOR)D4D_MulDivUU16((Word)_calc.refreshSize.cy, (Word)pData->page, (Word)(pData->maximum - pData->minimum));
138 
139  if(_calc.scrollSize.cy < D4D_SCRLBAR_MIN_TAB_SIZE)
140  _calc.scrollSize.cy = D4D_SCRLBAR_MIN_TAB_SIZE;
141 
142  _calc.scrollPos = _calc.refreshPos;
143  if(pData->maximum - pData->page - pData->minimum)
144  _calc.scrollPos.y += (D4D_COOR)(D4D_MulDivUU16((Word)(_calc.refreshSize.cy - _calc.scrollSize.cy - 1), (Word)pData->position, (Word)(pData->maximum - pData->page - pData->minimum)) + 1);
145  _calc.scrollPos.x++;
146  }
147 
148 
149  if(_calc.scrollRadius)
150  _calc.scrollRadius = (D4D_COOR)(pThis->radius - ((pThis->size.cx - _calc.contentGeom.sz.cx) / 2));
151 
152 }
153 
154 
155 
156 /*******************************************************
157 *
158 * SCROLL_BAR Drawing routine
159 *
160 *******************************************************/
161 
162 static void D4D_ScrlBrOnDraw(D4D_MESSAGE* pMsg)
163 {
164  D4D_OBJECT* pThis = pMsg->pObject;
165  D4D_OBJECT_DRAWFLAGS draw = pMsg->prm.draw;
166  D4D_COLOR clrT, clrB;
167  D4D_POINT tmp_point;
168  D4D_SIZE tmp_size;
169 
170  D4D_ScrlBrValue2Coor(pThis);
171 
172  clrT = D4D_ObjectGetForeColor(pThis, draw);
173  clrB = D4D_ObjectGetBckgColor(pThis, draw);
174 
175  // draw the rectangle around the text
177  D4D_FillRRect(&_calc.position, &pThis->size, clrB, pThis->radius);
178 
179  // Draw the frame & arrow buttons
180  if(draw & (D4D_OBJECT_DRAWFLAGS_COMPLETE | D4D_OBJECT_DRAWFLAGS_STATE))
181  {
182  D4D_DrawFrame(pThis, clrT, clrB);
183 
184  tmp_point = _calc.contentGeom.pnt;
185 
186  if(pThis->size.cx > pThis->size.cy)
187  {
188  // horizontal scroll bar
189  // draw first arrow button left
190 
191  tmp_size.cx = tmp_size.cy = _calc.contentGeom.sz.cy;
192 
193  D4D_RRect(&tmp_point, &tmp_size, D4D_LINE_THIN, clrT, _calc.scrollRadius);
194 
195  tmp_point.x += (D4D_COOR)(_calc.contentGeom.sz.cx - _calc.contentGeom.sz.cy);
196  D4D_RRect(&tmp_point, &tmp_size, D4D_LINE_THIN, clrT, _calc.scrollRadius);
197 
198  tmp_point.x = (D4D_COOR)(_calc.contentGeom.pnt.x + _calc.contentGeom.sz.cy / 8);
199  tmp_point.y += (D4D_COOR)(_calc.contentGeom.sz.cy / 2);
200  D4D_ScrlBrDrawArrow( &tmp_point,(D4D_COOR)((_calc.contentGeom.sz.cy / 2) - 2),D4D_DIR_LEFT,clrT);
201 
202  // draw second arrow button right
203  tmp_point.x = (D4D_COOR)(_calc.contentGeom.pnt.x + _calc.contentGeom.sz.cx - _calc.contentGeom.sz.cy / 8);
204  D4D_ScrlBrDrawArrow( &tmp_point,(D4D_COOR)((_calc.contentGeom.sz.cy / 2) - 2),D4D_DIR_RIGHT,clrT);
205 
206  }else
207  {
208  // vertical scroll bar
209  tmp_size.cx = tmp_size.cy = _calc.contentGeom.sz.cx;
210 
211  D4D_RRect(&tmp_point, &tmp_size, D4D_LINE_THIN, clrT, _calc.scrollRadius);
212 
213  tmp_point.y += (D4D_COOR)(_calc.contentGeom.sz.cy - _calc.contentGeom.sz.cx);
214  D4D_RRect(&tmp_point, &tmp_size, D4D_LINE_THIN, clrT, _calc.scrollRadius);
215 
216  tmp_point.y = (D4D_COOR)(_calc.contentGeom.pnt.y + _calc.contentGeom.sz.cx / 8);
217  tmp_point.x += (D4D_COOR)(_calc.contentGeom.sz.cx / 2);
218  D4D_ScrlBrDrawArrow( &tmp_point,(D4D_COOR)((_calc.contentGeom.sz.cx / 2) - 2),D4D_DIR_UP,clrT);
219 
220  // draw second arrow button right
221  tmp_point.y = (D4D_COOR)(_calc.contentGeom.pnt.y + _calc.contentGeom.sz.cy - _calc.contentGeom.sz.cx / 8);
222  D4D_ScrlBrDrawArrow( &tmp_point,(D4D_COOR)((_calc.contentGeom.sz.cx / 2) - 2),D4D_DIR_DOWN,clrT);
223  }
224  }
225 
226  D4D_FillRect(&_calc.refreshPos, &_calc.refreshSize, clrB);
227  D4D_FillRRect(&_calc.scrollPos, &_calc.scrollSize, clrT, _calc.scrollRadius);
228 
229 }
230 
231 /**************************************************************/
242 {
243 
244  D4D_COOR i,j;
245  D4D_POINT tmp_point = {0, 0};
246  D4D_POINT tmp_pointReal;
247  D4D_BOOL swap = D4D_FALSE;
248 
249  if((dir == D4D_DIR_LEFT) || (dir == D4D_DIR_RIGHT))
250  swap = D4D_TRUE;
251 
252  D4D_PutPixel(ppt, D4D_LINE_THIN, color);
253 
254  for(i = 0; i < size; i++)
255  {
256  if((dir == D4D_DIR_DOWN) || (dir == D4D_DIR_RIGHT))
257  tmp_point.y--;
258  else
259  tmp_point.y++;
260 
261  tmp_point.x--;
262 
263  if(swap)
264  tmp_pointReal = D4D_SwapCoor(tmp_point);
265  else
266  tmp_pointReal = tmp_point;
267 
268  tmp_pointReal.x += ppt->x;
269  tmp_pointReal.y += ppt->y;
270 
271 
272  D4D_MoveTo(&tmp_pointReal);
273 
274  j = tmp_point.x;
275  tmp_point.x += (i+1) * 2;
276 
277  if(swap)
278  tmp_pointReal = D4D_SwapCoor(tmp_point);
279  else
280  tmp_pointReal = tmp_point;
281 
282  tmp_pointReal.x += ppt->x;
283  tmp_pointReal.y += ppt->y;
284 
285  D4D_LineTo(&tmp_pointReal, D4D_LINE_THIN, color);
286 
287  tmp_point.x = j;
288  }
289 }
290 
291 #if defined(D4D_LLD_TCH) || defined(D4D_LLD_MOUSE)
292  static void D4D_ScrlBrOnTouch(D4D_MESSAGE* pMsg, D4D_POINT* point)
293  {
294  D4D_OBJECT* pThis = pMsg->pObject;
295 
297  {
298  if((D4D_GetFocusedObject(pMsg->pScreen) == pThis) || (pThis->pData->flags & D4D_OBJECT_F_FASTTOUCH))
299  {
300  D4D_SCROLL_BAR* pScrlBr = D4D_GET_SCROLL_BAR(pThis);
301  D4D_SCRLBAR_DATA* pData = pScrlBr->pData;
302 
303  if(pThis->pData->flags & D4D_OBJECT_F_TABSTOP)
304  D4D_CaptureKeys(pThis);
305 
306  if(pThis->size.cx > pThis->size.cy)
307  {
308  if(point->x > ((pThis->size.cx / 2) + pThis->position.x))
310  else
311  D4D_ScrlBrChangePosition(pThis, (D4D_INDEX_DELTA)(-1 * pData->step));
312  }else
313  {
314 
315  if(point->y > ((pThis->size.cy / 2) + pThis->position.y))
317  else
318  D4D_ScrlBrChangePosition(pThis, (D4D_INDEX_DELTA)(-1 * pData->step));
319  }
320 
321 
322  }
323  if(pThis->pData->flags & D4D_OBJECT_F_TABSTOP)
324  D4D_FocusSet(pMsg->pScreen, pThis);
325  }
326  }
327 #endif
328 
329 
331 {
332  D4D_OBJECT* pThis = pMsg->pObject;
333  D4D_SCROLL_BAR* pScrlBr = D4D_GET_SCROLL_BAR(pThis);
334  D4D_SCRLBAR_DATA* pData = pScrlBr->pData;
335 
336  if(pThis->size.cx > pThis->size.cy)
337  {
338  if(pMsg->prm.key == D4D_KEY_SCANCODE_LEFT)
339  D4D_ScrlBrChangePosition(pThis, (D4D_INDEX_DELTA)(-1 * pData->step));
340  else if(pMsg->prm.key == D4D_KEY_SCANCODE_RIGHT)
342  }else
343  {
344  if(pMsg->prm.key == D4D_KEY_SCANCODE_UP)
345  D4D_ScrlBrChangePosition(pThis, (D4D_INDEX_DELTA)(-1 * pData->step));
346  else if(pMsg->prm.key == D4D_KEY_SCANCODE_DOWN)
348  }
349 
350 }
351 
352 
353 
354 /******************************************************************************
355 * Begin of D4D_SCROLL_BAR public functions
356 */
360 /**************************************************************************/
369 {
370  D4D_SCROLL_BAR* pScrlBr = D4D_GET_SCROLL_BAR(pObj);
371  D4D_SCRLBAR_DATA* pData = pScrlBr->pData;
372 
373 
374  if(maximum < minimum)
375  return;
376 
377  pData->minimum = minimum;
378  pData->maximum = maximum;
379 
380  if(pData->step > pData->maximum)
381  pData->step = 1;
382 
383  if(pData->page > pData->maximum)
384  pData->page = 0;
385 
386  if(pData->position > pData->maximum)
387  pData->position = pData->maximum;
388 
389  if(pData->position < pData->minimum)
390  pData->position = pData->minimum;
391 
393 }
394 
395 /**************************************************************************/
404 {
405  D4D_SCROLL_BAR* pScrlBr = D4D_GET_SCROLL_BAR(pObj);
406  D4D_SCRLBAR_DATA* pData = pScrlBr->pData;
407 
408 
409  if(step > (pData->maximum - pData->minimum))
410  return;
411 
412  if(page > (pData->maximum - pData->minimum))
413  return;
414 
415  pData->step = step;
416  pData->page = page;
417 
419 }
420 
421 /**************************************************************************/
429 {
430  D4D_SCROLL_BAR* pScrlBr = D4D_GET_SCROLL_BAR(pObj);
431  D4D_SCRLBAR_DATA* pData = pScrlBr->pData;
432  D4D_INDEX old_pos = pData->position;
433 
434  if(position > (D4D_INDEX)(pData->maximum - pData->page))
435  pData->position = (D4D_INDEX)(pData->maximum - pData->page);
436  else if(position < pData->minimum)
437  pData->position = pData->minimum;
438  else
439  pData->position = position;
440 
441  if(pData->position == old_pos)
442  return;
443 
444  if(pScrlBr->OnChange != NULL)
445  pScrlBr->OnChange((D4D_OBJECT*)pObj, old_pos, pData->position);
446 
448 
449 }
450 
451 /**************************************************************************/
458 {
459  D4D_SCROLL_BAR* pScrlBr = D4D_GET_SCROLL_BAR(pObj);
460  D4D_SCRLBAR_DATA* pData = pScrlBr->pData;
461 
462  return pData->position;
463 }
464 
465 /**************************************************************************/
473 {
474  D4D_SCROLL_BAR* pScrlBr = D4D_GET_SCROLL_BAR(pObj);
475  D4D_SCRLBAR_DATA* pData = pScrlBr->pData;
476 
477  D4D_INDEX_DELTA tmp_pos = (D4D_INDEX_DELTA)(change + pData->position);
478 
479  if(tmp_pos < 0)
480  tmp_pos = 0;
481 
482  D4D_ScrlBrSetPosition(pObj, (D4D_INDEX)tmp_pos);
483 
484 }
485 /******************************************************************************
486 * End of public functions */
488 /******************************************************************************/
489 
490 /**************************************************************/
500 /*******************************************************
501 *
502 * The SCROLL_BAR message handler
503 *
504 *******************************************************/
505 
507 {
508  D4D_OBJECT* pThis = pMsg->pObject;
509 #if defined(D4D_LLD_TCH) || defined(D4D_LLD_MOUSE)
510  D4D_POINT touchClickPoint;
511 #endif
512  switch(pMsg->nMsgId)
513  {
514  case D4D_MSG_DRAW:
515  D4D_ScrlBrOnDraw(pMsg);
516  break;
517 
518  case D4D_MSG_KEYDOWN:
519  D4D_ScrlBrOnKeyDown(pMsg);
520  break;
521 
522 #ifdef D4D_LLD_MOUSE
524  touchClickPoint = D4D_GetMouseCoordinates(pMsg->pObject);
525  D4D_ScrlBrOnTouch(pMsg, &touchClickPoint);
526  break;
527 
529  D4D_ScrlBrChangePosition(pThis, -1);
530  break;
531 
533  D4D_ScrlBrChangePosition(pThis, 1);
534  break;
535 #endif
536 
537 #ifdef D4D_LLD_TCH
538  case D4D_MSG_TOUCHED:
539  case D4D_MSG_TOUCH_AUTO:
540  touchClickPoint = D4D_GetTouchScreenCoordinates(pMsg->pObject);
541  D4D_ScrlBrOnTouch(pMsg, &touchClickPoint);
542  break;
543 #endif
544 
545  case D4D_MSG_KILLFOCUS:
547  case D4D_MSG_SETFOCUS:
548  case D4D_MSG_SETCAPTURE:
549  case D4D_MSG_KILLCAPTURE:
551  break;
552 
553 
554  default:
555  // call the default behavior of all objects
556  D4D_ObjOnMessage(pMsg);
557  }
558 }
559 
D4D_COLOR D4D_ObjectGetBckgColor(D4D_OBJECT *pObj, D4D_OBJECT_DRAWFLAGS draw)
Function return object current background color.
Definition: d4d_scheme.c:185
Word D4D_MulDivUU16(Word u1, Word u2, Word d)
Simple proportion unsigned calculation - 16 bit.
Definition: d4d_math.c:257
#define D4D_KEY_SCANCODE_RIGHT
This macro is used to specify Key Scan Code RIGHT. If not defined, it sets to 0x4D as a default...
Definition: d4d_base.h:295
D4D_COLOR D4D_ObjectGetForeColor(D4D_OBJECT *pObj, D4D_OBJECT_DRAWFLAGS draw)
Function return object current fore color.
Definition: d4d_scheme.c:161
#define D4D_KEY_SCANCODE_UP
This macro is used to specify Key Scan Code UP. If not defined, it sets to 0x51 as a default...
Definition: d4d_base.h:280
static void D4D_ScrlBrValue2Coor(D4D_OBJECT *pThis)
void D4D_FillRect(D4D_POINT *ppt, D4D_SIZE *psz, D4D_COLOR color)
Function draw filled rectangle on the screen.
Type definition of eGUI point structure.
Definition: d4d_types.h:223
D4D object messages structure.
Definition: d4d_base.h:400
D4D_OBJECT_DATA_PTR pData
Pointer on runtime object data.
Definition: d4d_object.h:180
Mouse Whell Move Down message - is send in case that mouse whell move down is detected on this object...
Definition: d4d_base.h:390
#define D4D_FALSE
This is definition of boolean operation value in eGUI - FALSE.
Definition: d4d_types.h:104
#define D4D_OBJECT_F_TABSTOP
Object can be focused.
Definition: d4d_object.h:74
D4D_POINT D4D_SwapCoor(D4D_POINT point)
Function swap the point coordination.
Definition: d4d_base.c:534
void D4D_ScrlBrSetPosition(D4D_OBJECT_PTR pObj, D4D_INDEX position)
The function sets the scroll bar position.
#define D4D_GET_SCROLL_BAR(pObj)
D4D_SCRLBAR_DATA * pData
D4D_POINT D4D_GetTouchScreenCoordinates(D4D_OBJECT *pObject)
Set Focus message - is send when the object is getting focus.
Definition: d4d_base.h:373
#define D4D_TRUE
This is definition of boolean operation value in eGUI - TRUE.
Definition: d4d_types.h:106
void D4D_DrawFrame(D4D_OBJECT *pObject, D4D_COLOR clrT, D4D_COLOR clrB)
Function draw standard object frame based on the object settings and current state.
struct D4D_OBJECT_S * pObject
Pointer to object who is receiver of this message. If the receiver is just screen this field must be ...
Definition: d4d_base.h:402
D4D Driver main header file.
D4D_OBJECT_FLAGS flags
runtime object flags
Definition: d4d_object.h:145
Auto Touched message - is send when the object is still keep touch by touch screen driver ...
Definition: d4d_base.h:380
Direction UP.
Definition: d4d_types.h:309
#define D4D_GetMouseCoordinates(pObject)
Definition: d4d_mouse.h:226
static void D4D_ScrlBrOnDraw(D4D_MESSAGE *pMsg)
#define D4D_OBJECT_DRAWFLAGS_COMPLETE
Draw complete flag.
Definition: d4d_base.h:361
void D4D_ScrlBrSetRange(D4D_OBJECT_PTR pObj, D4D_INDEX minimum, D4D_INDEX maximum)
The function sets the range of scroll bar scale.
Mouse Left Button Release message - is send in case that mouse left release is detected on this objec...
Definition: d4d_base.h:384
D4D Driver private header file.
#define D4D_KEY_SCANCODE_DOWN
This macro is used to specify Key Scan Code DOWN. If not defined, it sets to 0x50 as a default...
Definition: d4d_base.h:285
#define D4D_DEFSTR(str)
Macro that helps declare the strings in eGUI.
Definition: d4d_string.h:246
Direction RIGHT.
Definition: d4d_types.h:311
D4D_COOR cx
Size in axis X (width)
Definition: d4d_types.h:232
Byte D4D_COOR
Type definition of eGUI coordination variables.
Definition: d4d_types.h:219
D4D_POINT position
Position on the screen/object.
Definition: d4d_object.h:169
const D4D_OBJECT_SYS_FUNCTION d4d_scroll_barSysFunc
#define D4D_OBJECT_DRAWFLAGS_STATE
Draw just change of state flag.
Definition: d4d_base.h:364
D4D_COOR radius
Object corners radius.
Definition: d4d_object.h:171
void D4D_ScrlBrSetStep(D4D_OBJECT_PTR pObj, D4D_INDEX page, D4D_INDEX step)
The function sets the step and page of scroll bar scale.
void D4D_ObjOnMessage(D4D_MESSAGE *pMsg)
Definition: d4d_object.c:443
void D4D_FocusSet(const D4D_SCREEN *pScreen, D4D_OBJECT_PTR pObject)
The function set the obejct focus to new object.
Definition: d4d_screen.c:430
#define NULL
Type definition of null pointer.
Definition: d4d_types.h:184
Direction LEFT.
Definition: d4d_types.h:312
D4D_COOR y
Coordination in axis Y.
Definition: d4d_types.h:226
D4D_OBJECT_PTR D4D_GetFocusedObject(const D4D_SCREEN *pScreen)
The function returns pointer to object that is focused in given screen.
Definition: d4d_screen.c:266
void D4D_PutPixel(D4D_POINT *ppt, D4D_LINETYPE type, D4D_COLOR color)
Function puts one pixel on the screen.
D4D_MSGID nMsgId
Type of message.
Definition: d4d_base.h:404
D4D_SIZE size
Size of the object.
Definition: d4d_object.h:170
void D4D_RRect(D4D_POINT *ppt, D4D_SIZE *psz, D4D_LINETYPE ltype, D4D_COLOR color, D4D_COOR radius)
Function draw rectangle on the screen with round corners.
D4D_DIRECTION
Type definition of eGUI direction type.
Definition: d4d_types.h:307
#define D4D_KEY_SCANCODE_LEFT
This macro is used to specify Key Scan Code LEFT. If not defined, it sets to 0x4B as a default...
Definition: d4d_base.h:290
D4D_KEY_SCANCODE key
There will be stored only code of key without release / press information - is valid with D4D_MSG_KEY...
Definition: d4d_base.h:409
D4D_POINT D4D_GetClientToScreenPoint(D4D_OBJECT *pObject, D4D_POINT *nClientPoint)
The function convert client point on the screen to the global screen point.
Definition: d4d_screen.c:536
LWord D4D_INDEX
Type definition of eGUI general index variables.
Definition: d4d_types.h:206
The object main structure type definition.
Definition: d4d_object.h:167
void D4D_CaptureKeys(D4D_OBJECT_PTR pObj)
Function switch on capturing the keys to objects.
Definition: d4d_object.c:190
Draw message - is send when the object should be redrawed.
Definition: d4d_base.h:371
Direction DOWN.
Definition: d4d_types.h:310
#define _calc
void D4D_ComputeGeometry(D4D_GEOMETRY *pGeometry, D4D_OBJECT *pObject)
Definition: d4d_base.c:1047
D4D_INDEX D4D_ScrlBrGetPosition(D4D_OBJECT_PTR pObj)
The function gets the scroll bar position.
D4D_COOR cy
Size in axis Y (height)
Definition: d4d_types.h:233
The object system function needed for each object - this is part of D4D_OBJECT main structure...
Definition: d4d_object.h:134
#define D4D_OBJECT_F_FASTTOUCH
Object has enabled fast touch screen capability. This option supports only a some objects (button...
Definition: d4d_object.h:76
Touched message - is send when the object is touched by touch screen driver.
Definition: d4d_base.h:379
LWord D4D_BOOL
Type definition of eGUI boolean.
Definition: d4d_types.h:204
Type definition of eGUI size structure.
Definition: d4d_types.h:230
void D4D_ScrlBrChangePosition(D4D_OBJECT_PTR pObj, D4D_INDEX_DELTA change)
The function change the scroll bar position.
sLWord D4D_INDEX_DELTA
Type definition of eGUI general index variables for signed offsets.
Definition: d4d_types.h:208
Kill Capture message - is send when the object is losing capture keys status.
Definition: d4d_base.h:376
D4D_OBJECT_DRAWFLAGS draw
Contains draw flags - is valid with D4D_MSG_DRAW and D4D_MSG_DRAWDONE message.
Definition: d4d_base.h:408
void D4D_FillRRect(D4D_POINT *ppt, D4D_SIZE *psz, D4D_COLOR color, D4D_COOR radius)
Function draw filled rectangle on the screen with round corners.
static void D4D_ScrlBrDrawArrow(D4D_POINT *ppt, D4D_COOR size, D4D_DIRECTION dir, D4D_COLOR color)
Type definition of eGUI geometry structure.
Definition: d4d_types.h:237
Line type thin.
Definition: d4d_types.h:293
static void D4D_ScrlBrOnMessage(D4D_MESSAGE *pMsg)
Set Capture message - is send when the object is getting capture keys status.
Definition: d4d_base.h:375
#define D4D_SCRLBAR_MIN_TAB_SIZE
This is minimal width of scroll bar in pixels. If not defined, it sets to 4 pixel as a default...
void D4D_InvalidateObject(D4D_OBJECT_PTR pObject, D4D_BOOL bComplete)
Function invalidate object to redraw on screen.
Definition: d4d_object.c:71
Key Down message - is send when the object get new Key Down event.
Definition: d4d_base.h:378
Byte D4D_OBJECT_DRAWFLAGS
Drawing object flags type, handled to object in D4D_MSG_DRAW events.
Definition: d4d_base.h:359
void D4D_LineTo(D4D_POINT *ppt, D4D_LINETYPE ltype, D4D_COLOR color)
Function draw line on the screen.
LWord D4D_COLOR
Type definition of eGUI color variables.
Definition: d4d_types.h:262
static void D4D_ScrlBrOnKeyDown(D4D_MESSAGE *pMsg)
struct D4D_SCREEN_S * pScreen
Pointer to screen who is receiver of this message.
Definition: d4d_base.h:403
Mouse Whell Move Up message - is send in case that mouse whell move up is detected on this object...
Definition: d4d_base.h:389
void D4D_MoveTo(D4D_POINT *ppt)
Function move logic cursor to new position.
unsigned short Word
Type definition of Word (unsigned 16-bit).
Definition: d4d_types.h:159
D4D_COOR x
Coordination in axis X.
Definition: d4d_types.h:225
Kill Focus message - is send when the object is losing focus.
Definition: d4d_base.h:374
union D4D_MESSAGE_S::@0 prm
Additional data for some type of messages.
D4D_SCRLBR_ON_CHANGE OnChange