Ejemplo n.º 1
0
BOOL
CTagDlg::OnCommand(int id, HWND hwndCtl, UINT notifyCode)
{
    switch(id)
    {
    case IDOK: OnOK();return TRUE;break;
    case IDCANCEL: OnCancel();return TRUE;break;
    case ID_HELP: OnHelp(); return TRUE; break;
    case IDC_VERIFY_HTML: OnVerifyHtml(); return TRUE; break;
    default: return FALSE;
    }
    return FALSE;
}
Ejemplo n.º 2
0
/**
 * @brief Handle dialog messages.
 * @param [in] hDlg Handle to the dialog.
 * @param [in] iMsg The message.
 * @param [in] wParam The command in the message.
 * @param [in] lParam The optional parameter for the command.
 * @return TRUE if the message was handled, FALSE otherwise.
 */
INT_PTR CopyHexdumpDlg::DlgProc(HWindow *pDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	switch (iMsg)
	{
	case WM_INITDIALOG:
		return OnInitDialog(pDlg);
	case WM_COMMAND:
		return OnCommand(pDlg, wParam, lParam);
	case WM_HELP:
		OnHelp(pDlg);
		break;
	}
	return FALSE;
}
Ejemplo n.º 3
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);

	switch(LOWORD(wParam))
	{
	case IDM_FILE_EXIT:			return OnFileExit();
	case IDM_VIEW_TEXT:			return OnViewText();
	case IDM_VIEW_LIST:			return OnViewList();
	case IDW_VIEW_STATUSBAR:	return OnViewStatusBar();
	case IDW_VIEW_TOOLBAR:		return OnViewToolBar();
	case IDM_HELP_ABOUT:		return OnHelp();
	}
	return FALSE;
}
Ejemplo n.º 4
0
STDMETHODIMP CMainFrame::Execute(UINT32 nCmdID, UI_EXECUTIONVERB verb, const PROPERTYKEY* key, const PROPVARIANT* ppropvarValue, IUISimplePropertySet* pCmdExProp)
{
	// This function is called when a ribbon button is pressed. 
	// Refer to IUICommandHandler::Execute in the Windows 7 SDK documentation 

	if (UI_EXECUTIONVERB_EXECUTE == verb)
	{
		switch(nCmdID)
		{
		case IDC_CMD_NEW:		OnFileNew();		break;
		case IDC_CMD_OPEN:		OnFileOpen();		break;
		case IDC_CMD_SAVE:		OnFileSave();		break;
		case IDC_CMD_SAVE_AS:	OnFileSaveAs();		break;
		case IDC_CMD_PRINT:		OnFilePrint();		break;
		case IDC_CMD_COPY:		TRACE("Copy\n");	break;
		case IDC_CMD_CUT:		TRACE("Cut\n");		break;
		case IDC_CMD_PASTE:		TRACE("Paste\n");	break;
		case IDC_CMD_ABOUT:		OnHelp();			break;
		case IDC_CMD_EXIT:		OnFileExit();		break;
		case IDC_RICHFONT:		TRACE("Font dialog\n");		break;
		case IDC_RIBBONHELP:	OnHelp();					break;
		case IDC_MRULIST:		OnMRUList(key, ppropvarValue);		break;
		case IDC_PEN_COLOR:		OnPenColor(ppropvarValue, pCmdExProp);	break;
		case IDC_CUSTOMIZE_QAT:	TRACE("Customize Quick Access ToolBar\n");	break;
		default:
			{
				CString str;
				str.Format(_T("Unknown Button %d\n"),nCmdID);
				TRACE(str);
			}
			break;
		}
	}

	return S_OK;
}
Ejemplo n.º 5
0
/**
 * @brief Handle dialog messages.
 * @param [in] hDlg Handle to the dialog.
 * @param [in] iMsg The message.
 * @param [in] wParam The command in the message.
 * @param [in] lParam The optional parameter for the command.
 * @return TRUE if the message was handled, FALSE otherwise.
 */
INT_PTR MoveCopyDlg::DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	switch (iMsg)
	{
	case WM_INITDIALOG:
		return OnInitDialog(hDlg);
	case WM_COMMAND:
		return OnCommand(hDlg, wParam, lParam);

	case WM_HELP:
		OnHelp(hDlg);
		break;
	}
	return FALSE;
}
Ejemplo n.º 6
0
/*-------------------------------------------
  dialog procedure
---------------------------------------------*/
INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)

{
	switch(message)
	{
		case WM_INITDIALOG:
			OnInitDialog(hDlg);
			return TRUE;
		case WM_COMMAND:
		{
			WORD id; // , code;
			id = LOWORD(wParam); // code = HIWORD(wParam);
			switch(id)
			{
				case IDC_APPLY:
					OnApply(hDlg);
					break;
				case IDC_MYHELP:
					OnHelp(hDlg);
					break;
				case IDOK:
					OnOK(hDlg);
				case IDCANCEL:
					if(g_hfontDialog)
						DeleteObject(g_hfontDialog);
					SetMyRegLong(NULL, "LastTreeItem", m_lastTreeItem);
					EndDialog(hDlg, id);
					break;
			}
			return TRUE;
		}
		case WM_NOTIFY:
		{
			NM_TREEVIEW* pNMTV = (NM_TREEVIEW *)lParam;
			if(pNMTV->hdr.code == TVN_SELCHANGED)
			{
				OnTVChanged(hDlg, (int)pNMTV->itemNew.lParam);
				return TRUE;
			}
			break;
		}
		case PSM_CHANGED:
			EnableDlgItem(hDlg, IDC_APPLY, TRUE);
			return TRUE;
	}
	return FALSE;
}
Ejemplo n.º 7
0
bool
WndProperty::on_mouse_down(int x, int y)
{
  POINT Pos;

  if (mDialogStyle) {
    if (!edit.is_read_only()) {
      // when they click on the label
      SingleWindow *root = (SingleWindow *)get_root_owner();

      /* if this asserton fails, then there no valid root window could
         be found - maybe it didn't register its wndproc? */
      assert(root != NULL);

      dlgComboPicker(*root, this);
    } else {
      OnHelp(); // this would display xml file help on a read-only wndproperty if it exists
    }
  } else {
    if (!edit.has_focus()) {
      if (!edit.is_read_only())
        edit.set_focus();

      return true;
    }

    Pos.x = x;
    Pos.y = y;
    //POINTSTOPOINT(Pos, MAKEPOINTS(lParam));

    mDownDown = (PtInRect(&mHitRectDown, Pos) != 0);
    if (mDownDown) {
      DecValue();
      invalidate(mHitRectDown);
    }

    mUpDown = (PtInRect(&mHitRectUp, Pos) != 0);
    if (mUpDown) {
      IncValue();
      invalidate(mHitRectUp);
    }

    set_capture();
  }

  return true;
}
Ejemplo n.º 8
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
    // OnCommand responds to menu and and toolbar input
    UNREFERENCED_PARAMETER(lParam);

    switch (LOWORD(wParam)) {
    case IDM_FILE_OPEN:
        // Refer to the tutorial for an example of OnFileOpen
        OnFileOpen();
        return TRUE;

    case IDM_FILE_SAVE:
        // Refer to the tutorial for an example of OnFileSave
        OnFileSave();
        return TRUE;

    case IDM_FILE_SAVEAS:
        // Refer to the tutorial for an example of OnFileSaveAs
        OnFileSave();
        return TRUE;

    case IDM_FILE_PRINT:
        OnFilePrint();
        return TRUE;

    case IDM_FILE_EXIT:
        // End the application
        ::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
        return TRUE;

    case IDW_VIEW_STATUSBAR:
        OnViewStatusBar();
        return TRUE;

    case IDW_VIEW_TOOLBAR:
        OnViewToolBar();
        return TRUE;

    case IDM_HELP_ABOUT:
        // Display the help dialog
        OnHelp();
        return TRUE;
    }

    return FALSE;
}
Ejemplo n.º 9
0
// unfortunately, under GTK we won't get the original wxKeyEvent
// to reset m_metaDown
void frmMain::OnTreeKeyDown(wxTreeEvent& event)
{
    switch (event.GetKeyCode())
    {
	case WXK_F1:
	    OnHelp(event);
	    break;
	case WXK_F5:
	    Refresh(currentObject);
	    break;
	case WXK_DELETE:
	    OnDelete(event);
	    break;
	default:
	    event.Skip();
	    break;
    }
}
Ejemplo n.º 10
0
bool CDialog::OnButtonClicked(int buttonID, HWND buttonHWND) 
{ 
  switch(buttonID)
  {
    case IDOK:
      OnOK();
      break;
    case IDCANCEL:
      OnCancel();
      break;
    case IDHELP:
      OnHelp();
      break;
    default:
      return false;
  }
  return true;
}
Ejemplo n.º 11
0
// Hellup!
afx_msg LRESULT CDynDialogEx::OnHelpMsg(WPARAM wParam, LPARAM lParam)
{
	//lParam		<<-- Contains: (LPHELPINFO)lParam
	// >> typedef  struct  tagHELPINFO { 
	//     UINT     cbSize; 
	//     int      iContextType 
	//     int      iCtrlId; 
	//     HANDLE   hItemHandle; 
	//     DWORD    dwContextId; 
	//     POINT    MousePos; 
	// } HELPINFO, FAR *LPHELPINFO;

	//
	// User pressed F1 in dialog, call the OnHelp() function, this can be overridden...
	//
	OnHelp();
	return TRUE;
}
Ejemplo n.º 12
0
void
WndProperty::BeginEditing()
{
  if (edit.is_read_only()) {
    /* this would display xml file help on a read-only wndproperty if
       it exists */
    OnHelp();
  } else if (mDialogStyle) {
    SingleWindow *root = (SingleWindow *)get_root_owner();

    /* if this asserton fails, then there no valid root window could
       be found - maybe it didn't register its wndproc? */
    assert(root != NULL);

    dlgComboPicker(*root, this);
  } else {
    edit.set_focus();
  }
}
Ejemplo n.º 13
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	// Process the messages from the Menu and Tool Bar
	switch (LOWORD(wParam))
	{
	case IDM_FILE_NEW:
		m_View.ClearPoints();
		m_PathName = _T("");
		return TRUE;
	case IDM_FILE_OPEN:
		OnFileOpen();
		return TRUE;
	case IDM_FILE_SAVE:
		OnFileSave();
		return TRUE;
	case IDM_FILE_SAVEAS:
		OnFileSaveAs();
		return TRUE;
	case IDM_FILE_PRINT:
		::MessageBox(NULL, _T("File Print Implemented Later"), _T("Menu"), MB_OK);
		return TRUE;
	case IDM_PEN_RED:
		m_View.SetPen(RGB(255,0,0));
		return TRUE;
	case IDM_PEN_BLUE:
		m_View.SetPen(RGB(0,0,255));
		return TRUE;
	case IDM_PEN_GREEN:
		m_View.SetPen(RGB(0,196,0));
		return TRUE;
	case IDM_PEN_BLACK:
		m_View.SetPen(RGB(0,0,0));
		return TRUE;
	case IDM_HELP_ABOUT:
		OnHelp();
		return TRUE;
	case IDM_FILE_EXIT:
		::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
		return TRUE;
	}

	return FALSE;
}
Ejemplo n.º 14
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	// OnCommand responds to menu and and toolbar input

	UNREFERENCED_PARAMETER(lParam);

	switch(LOWORD(wParam))
	{
	case IDM_FILE_EXIT:		 OnFileExit();		return TRUE;
	case IDM_MODELESS:		 OnModeless();		return TRUE;
	case IDM_MODAL:			 OnModal();			return TRUE;
	case IDM_WIZARD:		 OnWizard();		return TRUE;
	case IDW_VIEW_STATUSBAR: OnViewStatusBar();	return TRUE;
	case IDW_VIEW_TOOLBAR:	 OnViewToolBar();	return TRUE;
	case IDM_HELP_ABOUT:	 OnHelp();			return TRUE;
	}

	return FALSE;
}
Ejemplo n.º 15
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	// OnCommand responds to menu and and toolbar input

	UNREFERENCED_PARAMETER(lParam);

	switch(LOWORD(wParam))
	{
	case IDM_FILE_OPEN:			return OnFileOpen();
	case IDM_FILE_SAVE:			return OnFileSave();
	case IDM_FILE_SAVEAS:		return OnFileSave();
	case IDM_FILE_PRINT:		return OnFilePrint();
	case IDM_FILE_EXIT:			return OnFileExit();
	case IDW_VIEW_STATUSBAR:	return OnViewStatusBar();
	case IDW_VIEW_TOOLBAR:		return OnViewToolBar();
	case IDM_HELP_ABOUT:		return OnHelp();
	}

	return FALSE;
}
Ejemplo n.º 16
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);
	WORD wpLo = LOWORD(wParam);
    
	switch(LOWORD(wParam))
	{
	case ID_CHECK_A:		 m_SdiView.OnCheckA();	return TRUE;
	case ID_CHECK_B:		 m_SdiView.OnCheckB();	return TRUE;
	case ID_CHECK_C:		 m_SdiView.OnCheckC();	return TRUE;
	case IDM_FILE_EXIT:		 OnFileExit();			return TRUE;
	case IDW_VIEW_STATUSBAR: OnViewStatusBar();		return TRUE;
	case IDW_VIEW_TOOLBAR:	 OnViewToolBar();		return TRUE;
    case IDM_HELP_ABOUT:	 OnHelp();				return TRUE;
	case ID_RADIO_A:
	case ID_RADIO_B:		// intentionally blank
	case ID_RADIO_C:		m_SdiView.OnRangeOfIds_Radio(wpLo - ID_RADIO_A);	return TRUE;
    }

  return FALSE;
} 
Ejemplo n.º 17
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);

	switch (LOWORD(wParam))
	{
	case IDM_FILE_EXIT:			return OnFileExit();
	case IDM_HELP_ABOUT:		return OnHelp();
	case IDW_VIEW_STATUSBAR:	return OnViewStatusBar();
	case IDW_VIEW_TOOLBAR:		return OnViewToolBar();
	case IDM_VIEW_LARGEICON:	return OnViewLargeIcon();
	case IDM_VIEW_SMALLICON:	return OnViewSmallIcon();
	case IDM_VIEW_LIST:			return OnViewList();
	case IDM_VIEW_REPORT:		return OnViewReport();
	case IDM_SHOW_HIDDEN:		return OnShowHidden();
	case IDM_VIEWMENU:			return OnViewMenu();
	}

	return FALSE;

} // CMainFrame::OnCommand(...)
Ejemplo n.º 18
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	// Process the messages from the (non-ribbon) Menu and Tool Bar

	UNREFERENCED_PARAMETER(lParam);

	switch (LOWORD(wParam))
	{
	case IDM_FILE_NEW:			OnFileNew();			return TRUE;
	case IDM_FILE_OPEN:			OnFileOpen();			return TRUE;
	case IDM_FILE_SAVE:			OnFileSave();			return TRUE;
	case IDM_FILE_SAVEAS:		OnFileSaveAs();			return TRUE;
	case IDM_FILE_PRINT:		OnFilePrint();			return TRUE;

	case IDM_FILE_EXIT:			OnFileExit();			return TRUE;
	case IDW_FILE_MRU_FILE1:
	case IDW_FILE_MRU_FILE2:
	case IDW_FILE_MRU_FILE3:
	case IDW_FILE_MRU_FILE4:
	case IDW_FILE_MRU_FILE5:
		{
			UINT uMRUEntry = LOWORD(wParam) - IDW_FILE_MRU_FILE1;
			MRUFileOpen(uMRUEntry);
			return TRUE;
		}

	case IDM_PEN_RED:	SetPenColor(RGB(255, 0, 0));	return TRUE;
	case IDM_PEN_BLUE:	SetPenColor(RGB(0, 0, 255));	return TRUE;
	case IDM_PEN_GREEN:	SetPenColor(RGB(0, 196, 0));	return TRUE;
	case IDM_PEN_BLACK:	SetPenColor(RGB(0, 0, 0));		return TRUE;
	
	case IDW_VIEW_STATUSBAR:	return OnViewStatusBar();
	case IDW_VIEW_TOOLBAR:		return OnViewToolBar();
	case IDM_HELP_ABOUT:		return OnHelp();

	}

	return FALSE;
}
Ejemplo n.º 19
0
void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
{
    if (!m_propertySheet)
        return;

    if (win.GetName().empty())
        return;

    if (wxStrcmp(win.GetName(), wxT("ok")) == 0)
        OnOk(event);
    else if (wxStrcmp(win.GetName(), wxT("cancel")) == 0)
        OnCancel(event);
    else if (wxStrcmp(win.GetName(), wxT("help")) == 0)
        OnHelp(event);
    else if (wxStrcmp(win.GetName(), wxT("update")) == 0)
        OnUpdate(event);
    else if (wxStrcmp(win.GetName(), wxT("revert")) == 0)
        OnRevert(event);
    else
    {
        // Find a validator to route the command to.
        wxNode *node = m_propertySheet->GetProperties().GetFirst();
        while (node)
        {
            wxProperty *prop = (wxProperty *)node->GetData();
            if (prop->GetWindow() && (prop->GetWindow() == &win))
            {
                wxPropertyValidator *validator = FindPropertyValidator(prop);
                if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator)))
                {
                    wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator;
                    formValidator->OnCommand(prop, this, m_propertyWindow, event);
                    return;
                }
            }
            node = node->GetNext();
        }
    }
}
Ejemplo n.º 20
0
/**
 * @brief Process messages.
 * @param [in] hDlg Handle to dialog.
 * @param [in] iMsg Message ID.
 * @param [in] wParam First message parameter (depends on message).
 * @param [in] lParam Second message parameter (depends on message).
 * @return TRUE if message was handled, FALSE if ignored.
 */
INT_PTR CutDlg::DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	switch (iMsg)
	{
	case WM_INITDIALOG:
		return OnInitDialog(hDlg);
	case WM_COMMAND:
		switch (wParam)
		{
		case IDOK:
			if (Apply(hDlg))
			{
				EndDialog(hDlg, wParam);
			}
			return TRUE;
		case IDCANCEL:
			EndDialog(hDlg, wParam);
			return TRUE;
		}
		
		// Check for controls
		switch (LOWORD(wParam))
		{
		case IDC_CUT_INCLUDEOFFSET:  
		case IDC_CUT_NUMBEROFBYTES:
			EnableWindow(GetDlgItem(hDlg, IDC_CUT_NUMBYTES),
						IsDlgButtonChecked(hDlg, IDC_CUT_NUMBEROFBYTES));
			EnableWindow(GetDlgItem(hDlg, IDC_CUT_ENDOFFSET),
						IsDlgButtonChecked(hDlg, IDC_CUT_INCLUDEOFFSET));
			return TRUE;
		}
		break;

	case WM_HELP:
		OnHelp(hDlg);
		break;
	}
	return FALSE;
}
Ejemplo n.º 21
0
bool CDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
  switch (message)
  {
    case WM_INITDIALOG:
      return OnInit();
    case WM_COMMAND:
      return OnCommand(wParam, lParam);
    case WM_NOTIFY:
      return OnNotify(wParam, (LPNMHDR) lParam);
    case WM_HELP:
      {
        OnHelp((LPHELPINFO)lParam);
        return true;
      }
    case WM_TIMER:
      {
        return OnTimer(wParam, lParam);
      }
    default:
      return false;
  }
}
Ejemplo n.º 22
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	// OnCommand responds to menu and and toolbar input

	UNREFERENCED_PARAMETER(lParam);

	switch(LOWORD(wParam))
	{
	case IDM_FILE_OPEN:			OnFileOpen();			return TRUE;
	case IDM_FILE_SAVE:			OnFileSave();			return TRUE;
	case IDM_FILE_SAVEAS:		OnFileSave();			return TRUE;
	case IDM_FILE_PRINT:		OnFilePrint();			return TRUE;
	case IDM_FILE_EXIT:			OnFileExit();			return TRUE;
	case IDW_VIEW_STATUSBAR:	OnViewStatusBar();		return TRUE;
	case IDW_VIEW_TOOLBAR:		OnViewToolBar();		return TRUE;
	case IDM_TOOLBAR_CUSTOMIZE:	OnTBCustomize();		return TRUE;
	case IDM_TOOLBAR_DEFAULT:	OnTBDefault();			return TRUE;
	case IDM_TOOLBAR_BIGICONS:	OnTBBigIcons();			return TRUE;
	case IDM_HELP_ABOUT:		OnHelp();				return TRUE;
	}

	return FALSE;
}
Ejemplo n.º 23
0
bool CDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
  switch (message)
  {
    case WM_INITDIALOG: return OnInit();
    case WM_COMMAND: return OnCommand(wParam, lParam);
    case WM_NOTIFY: return OnNotify((UINT)wParam, (LPNMHDR) lParam);
    case WM_TIMER: return OnTimer(wParam, lParam);
    case WM_SIZE: return OnSize(wParam, LOWORD(lParam), HIWORD(lParam));
    case WM_HELP: OnHelp(); return true;
    /*
        OnHelp(
          #ifdef UNDER_CE
          (void *)
          #else
          (LPHELPINFO)
          #endif
          lParam);
        return true;
    */
    default: return false;
  }
}
Ejemplo n.º 24
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
    // Process the messages from the Menu and Tool Bar
    switch (LOWORD(wParam)) {
    case IDM_FILE_EXIT:
        // End the application
        ::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
        return TRUE;

    case IDM_HELP_ABOUT:
        // Display the help dialog
        OnHelp();
        return TRUE;

    case IDM_FILE_NEW:
        ::MessageBox(NULL, _T("File New  ... Implemented later"), _T("Menu"), MB_OK);
        return TRUE;

    case IDM_FILE_OPEN:
        ::MessageBox(NULL, _T("File Open  ... Implemented later"), _T("Menu"), MB_OK);
        return TRUE;

    case IDM_FILE_SAVE:
        ::MessageBox(NULL, _T("File Save  ... Implemented later"), _T("Menu"), MB_OK);
        return TRUE;

    case IDM_FILE_SAVEAS:
        ::MessageBox(NULL, _T("File SaveAs  ... Implemented later"), _T("Menu"), MB_OK);
        return TRUE;

    case IDM_FILE_PRINT:
        ::MessageBox(NULL, _T("File Print  ... Implemented later"), _T("Menu"), MB_OK);
        return TRUE;
    }

    return FALSE;
}
Ejemplo n.º 25
0
/*-------------------------------------------
  dialog procedure
---------------------------------------------*/
INT_PTR CALLBACK DlgProcPlayer(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_INITDIALOG:
			OnInit(hDlg);
			return TRUE;
		case WM_COMMAND:
		{
			int id; //, code;
			id = LOWORD(wParam); // code = HIWORD(wParam);
			switch(id)
			{
				case IDC_SHOWTIME:
					OnShowTime(hDlg);
					break;
				case IDC_SHOWWHOLE:
				case IDC_SHOWADD:
				case IDC_SHOWUSTR:
					OnUserStr(hDlg);
					break;
				case IDOK:
					OnOK(hDlg);
					break;
				case IDCANCEL:
					OnCancel(hDlg);
					break;
				case IDC_PLAYERHELP:
					OnHelp(hDlg);
					break;
			}
			return TRUE;
		}
	}
	return FALSE;
}
	/** This function helps with determining what a service application
	should do at startup. Early in the execution of the application, a call
	should be made to this function to test for command line parameters. If
	this function determines that the service should start, it will return
	VTRUE. Otherwise, it means the user wanted to only install or un-install
	the service, or show text mode help. Command line parameters that this
	function understands are as follows:

	-I = Install the Service. Calls the Install(VTRUE) virtual function.

	-U = Uninstall the Service. Calls the Install(VFALSE) virtual function.

	-? = Calls the OnHelp() virtual function to show text mode help.

	If any other parameters are specified, this function will call
	the virtual function OnCommandLineParameter().*/
	VBOOL					ProcessCommandLine()
	{
		VBOOL bServiceShouldStart = VTRUE;

		/* See if at least 1 command line param is present.*/
		if ( VGetARGC() > 0 )
		{
			VApplication& theApp = VGetApp();

			if ( theApp.IsCommandLineOption(VTEXT("I")) )
			{
				Install(VTRUE);
				bServiceShouldStart = VFALSE;
			}
			else if ( theApp.IsCommandLineOption(VTEXT("U")) )
			{
				Install(VFALSE);
				bServiceShouldStart = VFALSE;
			}
			else if ( theApp.IsCommandLineOption(VTEXT("?")) )
			{
				OnHelp();
				bServiceShouldStart = VFALSE;
			}

			if ( bServiceShouldStart )
			{
				for ( VUINT i = 1; i < VGetARGC(); i++ )
				{
					if ( !OnCommandLineParameter(VGetARGV(i)) )
						bServiceShouldStart = VFALSE;
				}
			}
		}

		return bServiceShouldStart;
	}
Ejemplo n.º 27
0
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);

	// Process the messages from the Menu and Tool Bar
	switch (LOWORD(wParam))
	{
	case IDM_FILE_NEW:			OnFileNew();		return TRUE;
	case IDM_FILE_OPEN:			OnFileOpen();		return TRUE;
	case IDM_FILE_SAVE:			OnFileSave();		return TRUE;
	case IDM_FILE_SAVEAS:		OnFileSaveAs();		return TRUE;
	case IDM_FILE_PRINT:		OnFilePrint();		return TRUE;
	case IDM_PEN_RED:			OnPenRed();			return TRUE;
	case IDM_PEN_BLUE:			OnPenBlue();		return TRUE;
	case IDM_PEN_GREEN:			OnPenGreen();		return TRUE;
	case IDM_PEN_BLACK:			OnPenBlack();		return TRUE;
	case IDW_VIEW_STATUSBAR:	OnViewStatusBar();	return TRUE;
	case IDW_VIEW_TOOLBAR:		OnViewToolBar();	return TRUE;
	case IDM_HELP_ABOUT:		OnHelp();			return TRUE;
	case IDM_FILE_EXIT:			OnFileExit();		return TRUE;
	}

	return FALSE;
}
Ejemplo n.º 28
0
// unfortunately, under GTK we won't get the original wxKeyEvent
// to reset m_metaDown
void frmMain::OnTreeKeyDown(wxTreeEvent &event)
{
	int keyCode = event.GetKeyCode();
	switch (keyCode)
	{
		case WXK_F1:
			OnHelp(event);
			break;
		case WXK_F5:
			Refresh(currentObject);
			break;
		case WXK_DELETE:
			OnDelete(event);
			break;
			// Is tempting to write all cases(this handler) in tree control itself
		case WXK_LEFT:
		case WXK_RIGHT:
			browser->NavigateTree(keyCode);
			break;
		default:
			event.Skip();
			break;
	}
}
Ejemplo n.º 29
0
BOOL CPPgScheduler::OnHelpInfo(HELPINFO* pHelpInfo)
{
	OnHelp();
	return TRUE;
}
Ejemplo n.º 30
0
BOOL CPPgScheduler::OnCommand(WPARAM wParam, LPARAM lParam)
{ 
	int item= m_actions.GetSelectionMark(); 
	// add
	if (wParam>=MP_SCHACTIONS && wParam<MP_SCHACTIONS+20 && m_actions.GetItemCount()<16)
	{
		uint8 action=wParam-MP_SCHACTIONS;
		uint8 i=m_actions.GetItemCount();
		m_actions.InsertItem(i,GetActionLabel(action));
		m_actions.SetItemData(i,action);
		m_actions.SetSelectionMark(i);
		if (action<6)
			OnCommand(MP_CAT_EDIT,0);
	}
	else if (wParam>=MP_SCHACTIONS+20 && wParam<=MP_SCHACTIONS+80)
	{
		CString newval;
		newval.Format(_T("%i"),wParam-MP_SCHACTIONS-22);
		m_actions.SetItemText(item,1,newval);
	}
	else if (wParam == ID_HELP)
	{
		OnHelp();
		return TRUE;
	}

	switch (wParam){ 
		case MP_CAT_EDIT: 
        { 
			if (item!=-1) {
				InputBox inputbox;
				// todo: differen prompts
				CString prompt;
				switch (m_actions.GetItemData(item)) {
					case 1:
					case 2:
						prompt=GetResString(IDS_SCHED_ENTERDATARATELIMIT)+_T(" (")+GetResString(IDS_KBYTESPERSEC)+_T(")");
						break;
					default: prompt=GetResString(IDS_SCHED_ENTERVAL);
				}
				inputbox.SetLabels(GetResString(IDS_SCHED_ACTCONFIG),prompt,m_actions.GetItemText(item,1));
				inputbox.DoModal();
				CString res=inputbox.GetInput();
				if (!inputbox.WasCancelled()) m_actions.SetItemText(item,1,res);
			}
			break; 
        }
		case MP_CAT_REMOVE:
		{
			// remove
			if (item!=-1) {
				int ix=m_actions.GetSelectionMark();
				if (ix!=-1) {
					m_actions.DeleteItem(ix);
				}
			}
			break;
		}
	} 
	return CPropertyPage::OnCommand(wParam, lParam);
}