Ejemplo n.º 1
0
void CzUITextBox::NotifyTapped(int index, int x, int y, bool allow_bubble)
{
	if (!Enabled)
		return;

	CzUILabel::NotifyTapped(index, x, y, allow_bubble);

	if (Prompt.isEmpty())
		Prompt = "Enter Text";

	const char* str = CZ_INPUT->showOnScreenKeyboard(Prompt.c_str(), TypeHint, Text.c_str());
	if (str != NULL)
	{
		setText(str);

		// Find and update target variable
		if (!TargetVariable.isEmpty())
		{
			CzXomlVariable* var = CzXomlVariable::GetVariable(TargetVariable, Scene);
			if (var != NULL)
				var->setValue(Text.c_str());
		}
		NotifyTextChanged();
	}

}
Ejemplo n.º 2
0
bool CCmdCtl_i::UiNotify(WPARAM wParam, 
                      LPARAM lParam, // pointer to notification structure
                      LRESULT* pResult)   
{
  NMHDR *phDR;
  phDR = (NMHDR*)lParam;
    
  // does notification come from my scintilla window?
  if (phDR != NULL && phDR->hwndFrom == m_hWnd)
  {
    SCNotification *pMsg = (SCNotification*)lParam;
    switch (phDR->code)
    {
    case SCN_STYLENEEDED:
      break;

    case SCN_CHARADDED:
      AddChar(pMsg->ch);
      break;
      
    case SCN_SAVEPOINTREACHED:
      break;

    //   called when the document is changed - mark document modified
    case SCN_SAVEPOINTLEFT:
      {
//         CDocument *pDoc = GetDocument();
//         pDoc->SetModifiedFlag(TRUE);
      }
      break;
    
    case SCN_MODIFYATTEMPTRO:
      break;
    
    case SCN_KEY:
      {
        //GetCurrentLineText();
      }
      break;
    case SCN_NEWLINE:
      NotifyNewLine(pMsg->pNewLine);
      break;
    
    case SCN_TAB:
      break;

    case SCN_KEY_DOWN:
      {
        BOOL bKeyDown = (::GetKeyState(pMsg->ch) & 0x80000000);
        
        int key       = pMsg->ch;
        char c        = (char)key;
        int modifiers = pMsg->modifiers;

        if(m_bBookMark)
        {
          if (bKeyDown && (modifiers & SCMOD_CTRL) && (modifiers & SCMOD_SHIFT) && (key == VK_F2))
          {
            ClearAllBookmarks();
          }
          else if (bKeyDown && (modifiers & SCMOD_CTRL) && (key == VK_F2))
          {
            SetDisplaySelection(TRUE);
            ToggleBookmark();
          }
          else if (bKeyDown && (modifiers & SCMOD_SHIFT) && (key == VK_F2))
          {
            JumpToBookmark(FALSE);
          }
          else if (bKeyDown && key == VK_F2)
          {
            JumpToBookmark(TRUE);
          }
        }
      }
      break;
    
    case SCN_DOUBLECLICK:
      NotifyDoubleClick();
      break;
      
      //       called when something changes and we want to show new indicator state or brace matching
    case SCN_UPDATEUI:
      {
        UpdateUI();
      }
      break;
      
    case SCEN_CHANGE:
      break;
      
    case SCN_ZOOM:
    case SCN_MODIFIED:
      {
        NotifyTextChanged();
      }      
      break;
      
    case SCN_MACRORECORD:
      break;

      // user clicked margin - try folding action
    case SCN_MARGINCLICK:
      {
        DoDefaultFolding(pMsg->margin, pMsg->position);
      }
      break;
    
    case SCN_NEEDSHOWN:
      break;
    case SCN_PAINTED:
      break;
    case SCN_USERLISTSELECTION:
      break;
    case SCN_URIDROPPED:
      break;
    case SCN_DWELLSTART:
      break;
    case SCN_DWELLEND:
      break;
    }
    return TRUE; // we processed the message
  }

  return TRUE;
}