コード例 #1
0
ファイル: d4d_check_box.c プロジェクト: ErichStyger/eGUI
void D4D_CheckBoxOnMessage(D4D_MESSAGE* pMsg)
{
  switch(pMsg->nMsgId)
  {
  case D4D_MSG_DRAW:
      D4D_CheckBoxOnDraw(pMsg);
      break;
      
  case D4D_MSG_KEYDOWN:
      D4D_CheckBoxOnKeyDown(pMsg);
      break;

  case D4D_MSG_KEYUP:
      D4D_CheckBoxOnKeyUp(pMsg);
      break;
      
  case D4D_MSG_KILLFOCUS:
      D4D_CheckBoxKillFocus(pMsg);
      break;
    
#if defined(D4D_LLD_TCH) || defined(D4D_LLD_MOUSE)     
    case D4D_MSG_MOUSE_BTN_LEFT_UP:
      if(D4D_GetMouseHoverObject() != pMsg->pObject)
        break;
    case D4D_MSG_TOUCHED:     
      D4D_CheckBoxTouched(pMsg);
      break;
#endif        

    default:
        // call the default behavior
        D4D_ObjOnMessage(pMsg);
    }
}
コード例 #2
0
ファイル: d4d_progress_bar.c プロジェクト: ErichStyger/eGUI
void D4D_PrgrsBarOnMessage(D4D_MESSAGE* pMsg)
{
    D4D_CLR_SCHEME *pScheme_tmp = D4D_ObjectGetScheme(pMsg->pObject);
    
    switch(pMsg->nMsgId)
    {
    case D4D_MSG_DRAW:
        D4D_PrgrsBarOnDraw(pMsg);
        break;       

    
    case D4D_MSG_ONINIT:
        pMsg->pObject->pData->flags &= ~D4D_OBJECT_F_NOTINIT;
    
        if(!(pMsg->pObject->initFlags & (D4D_PRGRS_BAR_F_BAR_AUTOCOLOR | D4D_PRGRS_BAR_F_BAR_SCALECOLOR)))
          D4D_GET_PROGRESS_BAR(pMsg->pObject)->pData->colorBar = pScheme_tmp->objectDepend.progressBar.barFore;                    
        else
          D4D_GET_PROGRESS_BAR(pMsg->pObject)->pData->colorBar = D4D_PrgrsBarComputeColorBar(pMsg->pObject, D4D_GET_PROGRESS_BAR(pMsg->pObject)->pData->value);  
        break;        

    default:
        // call the default behavior of all objects
        D4D_ObjOnMessage(pMsg);
    }
}
コード例 #3
0
ファイル: d4d_menu.c プロジェクト: Gargy007/eGUI
void D4D_MenuOnMessage(D4D_MESSAGE* pMsg)
{
  #if defined(D4D_LLD_TCH) || defined(D4D_LLD_MOUSE)
  D4D_POINT touchClickPoint;
  #endif
  switch(pMsg->nMsgId)
  {
    case D4D_MSG_DRAW:
      D4D_MenuOnDraw(pMsg);
      break;

    case D4D_MSG_KEYDOWN:
      D4D_MenuOnKeyDown(pMsg);
      break;

    case D4D_MSG_KEYUP:
      D4D_MenuOnKeyUp(pMsg);
      break;

#ifdef D4D_LLD_MOUSE
    case D4D_MSG_MOUSE_BTN_LEFT_UP:
        touchClickPoint = D4D_GetMouseCoordinates(pMsg->pObject);
        D4D_MenuOnTouch(pMsg, &touchClickPoint);
      break;

    case D4D_MSG_MOUSE_BTN_WHEEL_UP:
      D4D_MenuFocusPreviousItem(pMsg->pObject);
      break;

    case D4D_MSG_MOUSE_BTN_WHEEL_DOWN:
      D4D_MenuFocusNextItem(pMsg->pObject);
      break;

#endif

#ifdef D4D_LLD_TCH
    case D4D_MSG_TOUCHED:
    case D4D_MSG_TOUCH_AUTO:
        touchClickPoint = D4D_GetTouchScreenCoordinates(pMsg->pObject);
        D4D_MenuOnTouch(pMsg, &touchClickPoint);
      break;
#endif
    case D4D_MSG_ONINIT:
      pMsg->pObject->pData->flags &= ~D4D_OBJECT_F_NOTINIT;

      D4D_MenuOnInit(pMsg);
      break;

    default:
      // call the default behavior of all objects
      D4D_ObjOnMessage(pMsg);
  }
}
コード例 #4
0
ファイル: d4d_scroll_bar.c プロジェクト: Gargy007/eGUI
void D4D_ScrlBrOnMessage(D4D_MESSAGE* pMsg)
{
  D4D_OBJECT* pThis = pMsg->pObject;
#if defined(D4D_LLD_TCH) || defined(D4D_LLD_MOUSE)
  D4D_POINT touchClickPoint;
#endif
  switch(pMsg->nMsgId)
  {
    case D4D_MSG_DRAW:
      D4D_ScrlBrOnDraw(pMsg);
      break;

    case D4D_MSG_KEYDOWN:
      D4D_ScrlBrOnKeyDown(pMsg);
      break;

#ifdef D4D_LLD_MOUSE
    case D4D_MSG_MOUSE_BTN_LEFT_UP:
        touchClickPoint = D4D_GetMouseCoordinates(pMsg->pObject);
        D4D_ScrlBrOnTouch(pMsg, &touchClickPoint);
      break;

    case D4D_MSG_MOUSE_BTN_WHEEL_UP:
      D4D_ScrlBrChangePosition(pThis, -1);
      break;

    case D4D_MSG_MOUSE_BTN_WHEEL_DOWN:
      D4D_ScrlBrChangePosition(pThis, 1);
      break;
#endif

#ifdef D4D_LLD_TCH
    case D4D_MSG_TOUCHED:
    case D4D_MSG_TOUCH_AUTO:
      touchClickPoint = D4D_GetTouchScreenCoordinates(pMsg->pObject);
      D4D_ScrlBrOnTouch(pMsg, &touchClickPoint);
      break;
#endif

    case D4D_MSG_KILLFOCUS:
      D4D_CaptureKeys(NULL);
    case D4D_MSG_SETFOCUS:
    case D4D_MSG_SETCAPTURE:
    case D4D_MSG_KILLCAPTURE:
      D4D_InvalidateObject(pThis, D4D_FALSE);
      break;


    default:
      // call the default behavior of all objects
      D4D_ObjOnMessage(pMsg);
  }
}
コード例 #5
0
ファイル: d4d_icon.c プロジェクト: ErichStyger/eGUI
void D4D_IconOnMessage(D4D_MESSAGE* pMsg)
{

#if D4D_ICON_ENABLE_ANIMATION == D4D_TRUE
  D4D_ICON* pIcon = D4D_GET_ICON(pMsg->pObject);
  D4D_ICON_DATA* pData = pIcon->pData;
#endif

  switch(pMsg->nMsgId)
  {
    

      
    case D4D_MSG_DRAW:
      D4D_IconOnDraw(pMsg);
      break;
      
#ifdef D4D_LLD_TCH       
    case D4D_MSG_TOUCHED:
      D4D_FocusSet(pMsg->pScreen, pMsg->pObject);
      break;
#endif

#if D4D_ICON_ENABLE_ANIMATION == D4D_TRUE
    
    case D4D_MSG_ONINIT:
      pMsg->pObject->pData->flags &= ~D4D_OBJECT_F_NOTINIT;
      
      pData->tickCounterTrshld = D4D_ICON_ANIMATION_TICK_COUNTER;
      break;
    
    case D4D_MSG_TIMETICK:
      if(pData->animationEnabled)
      {
        if(++(pData->tickCounter) > pData->tickCounterTrshld)
        {
          pData->tickCounter = 0;
          // update animation (change icon)
          D4D_IconChangeIndex(pMsg->pObject, 1);  
        }
      }
      break;
#endif      

    default:
      // call the default behavior of all objects
      D4D_ObjOnMessage(pMsg);
  }
}
コード例 #6
0
ファイル: d4d_label.c プロジェクト: Gargy007/eGUI
void D4D_LabelOnMessage(D4D_MESSAGE* pMsg)
{
    switch(pMsg->nMsgId)
    {
    case D4D_MSG_DRAW:
        D4D_LabelOnDraw(pMsg);
        break;
#ifdef D4D_LLD_TCH
    case D4D_MSG_TOUCHED:
        D4D_FocusSet(pMsg->pScreen, pMsg->pObject);
        break;
#endif
    default:
        // call the default behavior of all objects
        D4D_ObjOnMessage(pMsg);
    }
}
コード例 #7
0
ファイル: d4d_combo_box.c プロジェクト: Gargy007/eGUI
static void D4D_ComboBoxOnMessage(D4D_MESSAGE* pMsg)
{
  switch(pMsg->nMsgId)
  {
    case D4D_MSG_ONINIT:
      {
        D4D_OBJECT* pListBoxObject = D4D_GET_COMBO_BOX_LIST_BOX(pMsg->pObject);
        D4D_OBJECT* pEditBoxObject = D4D_GET_COMBO_BOX_EDIT_BOX(pMsg->pObject);

        pMsg->pObject->pData->flags &= ~D4D_OBJECT_F_NOTINIT;

        D4D_GET_COMBO_BOX_DATA(pMsg->pObject)->real_ix = D4D_ListBoxGetIndex(pListBoxObject);
        D4D_EditBoxClearAll(pEditBoxObject);
        D4D_EditBoxPutString(pEditBoxObject, D4D_ListBoxGetItemText(pListBoxObject));
      }

      break;

    default:
      // call the default behavior of all objects
      D4D_ObjOnMessage(pMsg);
  }
}
コード例 #8
0
ファイル: d4d_text_box.c プロジェクト: Gargy007/eGUI
void D4D_TextBoxOnMessage(D4D_MESSAGE* pMsg)
{
  D4D_OBJECT* pThis = pMsg->pObject;

  switch(pMsg->nMsgId)
  {
    case D4D_MSG_DRAW:
      D4D_TextBoxOnDraw(pMsg);
      break;

    case D4D_MSG_ONINIT:
      pThis->pData->flags &= ~D4D_OBJECT_F_NOTINIT;

      D4D_TextBoxOnInit(pThis);
      break;

#ifdef D4D_LLD_TCH
    case D4D_MSG_TOUCHED:
      D4D_FocusSet(pMsg->pScreen, pThis);
      D4D_CaptureKeys(pThis);
      break;
#endif

#ifdef D4D_LLD_MOUSE
    case D4D_MSG_MOUSE_BTN_LEFT_UP:
      D4D_FocusSet(pMsg->pScreen, pThis);
      D4D_CaptureKeys(pThis);
      break;

    case D4D_MSG_MOUSE_BTN_WHEEL_UP:
      if(D4D_GET_TEXTBOX_SCROLL_BAR_HOR(pThis)->pData->flags & D4D_OBJECT_F_VISIBLE)
        D4D_ScrlBrChangePosition(D4D_GET_TEXTBOX_SCROLL_BAR_HOR(pThis), -1);
      break;
    case D4D_MSG_MOUSE_BTN_WHEEL_DOWN:
      if(D4D_GET_TEXTBOX_SCROLL_BAR_HOR(pThis)->pData->flags & D4D_OBJECT_F_VISIBLE)
        D4D_ScrlBrChangePosition(D4D_GET_TEXTBOX_SCROLL_BAR_HOR(pThis), 1);
      break;
#endif

    case D4D_MSG_KEYUP:
      {
        D4D_KEY_SCANCODE tmp_key = pMsg->prm.key;
        // capture the keyboard if enter is pressed
        if(tmp_key == D4D_KEY_SCANCODE_ENTER)
          D4D_CaptureKeys(pThis);

        // exit capture
        if(tmp_key == D4D_KEY_SCANCODE_ESC)
          D4D_CaptureKeys(NULL);
      }
      break;

    case D4D_MSG_KILLFOCUS:
      D4D_CaptureKeys(NULL);
    case D4D_MSG_SETFOCUS:
    case D4D_MSG_SETCAPTURE:
    case D4D_MSG_KILLCAPTURE:
      //D4D_InvalidateObject(pThis, D4D_FALSE);
      break;


    default:
      // call the default behavior of all objects
      D4D_ObjOnMessage(pMsg);
  }
}
コード例 #9
0
ファイル: d4d_slider.c プロジェクト: Learnee/eGUI
void D4D_SldrOnMessage(D4D_MESSAGE* pMsg)
{
    D4D_OBJECT* pThis = pMsg->pObject;
    D4D_CLR_SCHEME *pScheme_tmp = D4D_ObjectGetScheme(pThis);

    #if defined(D4D_LLD_TCH)
    static D4D_INDEX autoTouchTicks;
    #endif

    #if defined(D4D_LLD_MOUSE)
    D4D_SLIDER* pSldr = D4D_GET_SLIDER(pThis);
    #endif

    #if defined(D4D_LLD_TCH) || defined(D4D_LLD_MOUSE)
    D4D_POINT touchClickPoint;
    #endif

    switch(pMsg->nMsgId)
    {
    case D4D_MSG_DRAW:
        D4D_SldrOnDraw(pMsg);
        break;

    case D4D_MSG_KEYUP:
        D4D_SldrOnKeyUp(pMsg);
        break;

    case D4D_MSG_KILLFOCUS:
        D4D_CaptureKeys(NULL);
        break;

    case D4D_MSG_ONINIT:
        pThis->pData->flags &= ~D4D_OBJECT_F_NOTINIT;

        if(!(pThis->initFlags & (D4D_SLDR_F_BAR_AUTOCOLOR | D4D_SLDR_F_BAR_SCALECOLOR)))
          D4D_GET_SLIDER(pThis)->pData->colorBar = pScheme_tmp->objectDepend.slider.barFore;
        else
          D4D_GET_SLIDER(pThis)->pData->colorBar = D4D_SldrComputeColorBar(pThis, D4D_GET_SLIDER(pThis)->pData->value);
        break;

#ifdef D4D_LLD_MOUSE
    case D4D_MSG_MOUSE_BTN_LEFT_UP:
        touchClickPoint = D4D_GetMouseCoordinates(pMsg->pObject);
        D4D_SldrTouched(pMsg, &touchClickPoint);
      break;

    case D4D_MSG_MOUSE_BTN_WHEEL_UP:
      D4D_SldrChangeValue(pThis, pSldr->pData->limits.step);
      break;

    case D4D_MSG_MOUSE_BTN_WHEEL_DOWN:
      D4D_SldrChangeValue(pThis, -pSldr->pData->limits.step);
      break;
#endif



#ifdef D4D_LLD_TCH
    case D4D_MSG_TOUCH_AUTO:
        if(pThis->initFlags & D4D_SLDR_F_AUTOTOUCH_OFF)
          break;

        if(autoTouchTicks--)
          break;

    case D4D_MSG_TOUCHED:
        autoTouchTicks = D4D_SLDR_AUTOTOUCHTICKS;
        touchClickPoint = D4D_GetTouchScreenCoordinates(pMsg->pObject);
        D4D_SldrTouched(pMsg, &touchClickPoint);
        break;
#endif
    default:
        // call the default behavior of all objects
        D4D_ObjOnMessage(pMsg);
    }
}