Exemple #1
0
void D4D_ComboBoxListFeedBack(D4D_OBJECT* pThis, D4D_EVENTID eventId)
{
  D4D_OBJECT* pParent = D4D_GetParentObject(pThis);

  if(eventId == D4D_EVENT_ONCLICK)
  {
    D4D_OBJECT* pListBoxObject = D4D_GET_COMBO_BOX_LIST_BOX(pParent);
    D4D_OBJECT* pEditBoxObject = D4D_GET_COMBO_BOX_EDIT_BOX(pParent);

    D4D_GET_COMBO_BOX_DATA(pParent)->real_ix = D4D_ListBoxGetIndex(pListBoxObject);

    if(D4D_GET_COMBO_BOX(pParent)->OnEvent)
      D4D_GET_COMBO_BOX(pParent)->OnEvent(pParent, D4D_EVENT_ONCLICK);

    D4D_EditBoxClearAll(pEditBoxObject);
    D4D_EditBoxPutString(pEditBoxObject, D4D_ListBoxGetItemText(pListBoxObject));

    D4D_ShowObject(pListBoxObject, D4D_FALSE);
    D4D_InvalidateScreen(pParent->pData->pScreen, D4D_TRUE);
  }

  if(eventId == D4D_EVENT_ONCHANGE)
  {
    //D4D_InvalidateObject(pParent, D4D_FALSE);

    if(D4D_GET_COMBO_BOX(pParent)->OnEvent)
      D4D_GET_COMBO_BOX(pParent)->OnEvent(pParent, D4D_EVENT_ONCHANGE);
  }
}
Exemple #2
0
static void D4D_ComboBoxStornoSelection(D4D_OBJECT * pThis)
{
  D4D_OBJECT* pListBoxObject = D4D_GET_COMBO_BOX_LIST_BOX(pThis);

  if(D4D_IsVisible(pListBoxObject))
  {
    D4D_ShowObject(pListBoxObject, D4D_FALSE);
    D4D_InvalidateScreen(pThis->pData->pScreen, D4D_TRUE);      //TODO
  }

  D4D_ListBoxSetIndex(pListBoxObject, D4D_GET_COMBO_BOX_DATA(pThis)->real_ix);

}
Exemple #3
0
void D4D_ComboBoxButtonFeedBack(D4D_OBJECT* pThis)
{
  D4D_OBJECT* pParent = D4D_GetParentObject(pThis);
  D4D_OBJECT* pListBoxObject = D4D_GET_COMBO_BOX_LIST_BOX(pParent);

  if(D4D_IsVisible(pListBoxObject))
  {
    D4D_ComboBoxStornoSelection(pParent);
  }else
  {
    D4D_ShowObject(pListBoxObject, D4D_TRUE);
    D4D_CaptureKeys(pListBoxObject);
    D4D_InvalidateObject(pParent, D4D_TRUE);
  }
}
Exemple #4
0
static void D4D_CnslOnInit(D4D_MESSAGE* pMsg)
{
    D4D_OBJECT* pThis = pMsg->pObject;
    D4D_CONSOLE* pCnsl = D4D_GET_CONSOLE(pMsg->pObject);

    D4D_CnslValue2Coor(pThis);

    if((_calc.charArrSize.cy < pCnsl->txtArrSize.cy)||(_calc.charArrSize.cx < pCnsl->txtArrSize.cx))
    {
        D4D_ScrlBrSetRange(D4D_GET_LIST_BOX_SCROLL_BAR_HOR(pThis), 0, pCnsl->txtArrSize.cx);
        D4D_ScrlBrSetStep(D4D_GET_LIST_BOX_SCROLL_BAR_HOR(pThis), _calc.charArrSize.cx, D4D_CNSL_SCRLBR_STEP_H);
        D4D_ShowObject(D4D_GET_LIST_BOX_SCROLL_BAR_HOR(pThis), D4D_TRUE);

        D4D_ScrlBrSetRange(D4D_GET_LIST_BOX_SCROLL_BAR_VER(pThis), 0, pCnsl->txtArrSize.cy);
        D4D_ScrlBrSetStep(D4D_GET_LIST_BOX_SCROLL_BAR_VER(pThis), _calc.charArrSize.cy, D4D_CNSL_SCRLBR_STEP_V);
        D4D_ShowObject(D4D_GET_LIST_BOX_SCROLL_BAR_VER(pThis), D4D_TRUE);
    }
    else
    {
        D4D_ShowObject(D4D_GET_LIST_BOX_SCROLL_BAR_HOR(pThis), D4D_FALSE);
        D4D_ShowObject(D4D_GET_LIST_BOX_SCROLL_BAR_VER(pThis), D4D_FALSE);
    }

}