int __stdcall ModuleEntry ( int nFunctionID, void *pParams ) { switch ( nFunctionID ) { case FID_INITIALIZE: return OnInitialize ((StartupInfo*)pParams); case FID_FINALIZE: return OnFinalize (); case FID_QUERYARCHIVE: return OnQueryArchive ((QueryArchiveStruct*)pParams); case FID_STARTOPERATION: return OnStartOperation ((OperationStruct*)pParams); case FID_ENDOPERATION: return OnEndOperation ((OperationStruct*)pParams); case FID_GETARCHIVEMODULEINFO: return OnGetArchiveModuleInfo ((ArchiveModuleInfo*)pParams); case FID_GETARCHIVEITEM: return OnGetArchiveItem((GetArchiveItemStruct*)pParams); case FID_FREEARCHIVEITEM: return OnFreeArchiveItem((FreeArchiveItemStruct*)pParams); case FID_EXTRACT: return OnExtract ((ExtractStruct*)pParams); case FID_TEST: return OnTest ((TestStruct*)pParams); case FID_GETDEFAULTCOMMAND: return OnGetDefaultCommand ((GetDefaultCommandStruct*)pParams); case FID_DELETE: return OnDelete ((DeleteStruct*)pParams); case FID_ADD: return OnAdd ((AddStruct*)pParams); case FID_CREATEARCHIVE: case FID_OPENARCHIVE: return OnOpenCreateArchive ((OpenCreateArchiveStruct*)pParams); case FID_CONFIGUREFORMAT: return OnConfigureFormat((ConfigureFormatStruct*)pParams); case FID_CLOSEARCHIVE: return OnCloseArchive((CloseArchiveStruct*)pParams); } return NAERROR_NOTIMPLEMENTED; }
// 修改 void CListPage::OnClickedButton3() { int index = m_list.GetSelectionMark(); if (index == LB_ERR) return; if (SetItem(index)) OnAdd(index); }
void MainWindow::OnEnter() { if (ui->fNoteList->currentIndex().isValid()) { ui->fEditor->setFocus(); ui->fEditor->moveCursor(QTextCursor::End); } else if (!ui->fSearchEdit->text().isEmpty()) { OnAdd(ui->fSearchEdit->text()); ui->fEditor->setFocus(); ui->fEditor->moveCursor(QTextCursor::End); } }
// 导入 void CListPage::OnClickedButton5() { CFileDialog dlg(TRUE, _T("xml"), NULL, 0, _T("XML文件 (*.xml)|*.xml|TXT文件 (*.txt)|*.txt|所有文件 (*.*)|*.*||"), this); if (dlg.DoModal() == IDOK) { if (!Import(dlg.GetPathName())) AfxMessageBox(_T("读取失败!"), MB_ICONERROR); else OnAdd(-1); } }
int __stdcall PluginEntry ( int nFunctionID, void *pParams ) { switch ( nFunctionID ) { case FID_INITIALIZE: return OnInitialize ((StartupInfo*)pParams); case FID_FINALIZE: return OnFinalize (); case FID_QUERYARCHIVE: return OnQueryArchive ((QueryArchiveStruct*)pParams); case FID_OPENARCHIVE: return OnOpenArchive ((OpenArchiveStruct*)pParams); case FID_CLOSEARCHIVE: return OnCloseArchive ((CloseArchiveStruct*)pParams); case FID_FINALIZEARCHIVE: return OnFinalizeArchive ((AceArchive*)pParams); case FID_GETARCHIVEPLUGININFO: return OnGetArchivePluginInfo ((ArchivePluginInfo*)pParams); case FID_GETARCHIVEITEM: return OnGetArchiveItem ((GetArchiveItemStruct*)pParams); case FID_GETARCHIVEFORMAT: return OnGetArchiveFormat ((GetArchiveFormatStruct*)pParams); case FID_EXTRACT: return OnExtract ((ExtractStruct*)pParams); case FID_GETDEFAULTCOMMAND: return OnGetDefaultCommand ((GetDefaultCommandStruct*)pParams); case FID_ADD: return OnAdd ((AddStruct*)pParams); case FID_DELETE: return OnDelete ((DeleteStruct*)pParams); case FID_CREATEARCHIVE: return OnCreateArchive ((CreateArchiveStruct*)pParams); } return NAERROR_NOTIMPLEMENTED; }
// 添加 void CListPage::OnClickedButton1() { int index = m_list.GetSelectionMark() + 1; index = m_list.InsertItem(index, NULL); if (SetItem(index)) { m_list.SetSelectionMark(index); m_list.SetItemState(index, LVNI_FOCUSED | LVNI_SELECTED, LVNI_FOCUSED | LVNI_SELECTED); OnAdd(index); } else m_list.DeleteItem(index); }
void MatTaskAddWidget::OnAction(int id) { switch ((Action)id) { case DISMISS: break; case ADD: OnAdd(); break; } PageActions::RestoreBottom(); }
CPropertiesView::CPropertiesView(bool bWithButtons, QWidget *parent) :QWidget(parent) { m_ReadOnly = false; m_pMainLayout = new QVBoxLayout(); m_pPropertiesTree = new QTreeWidget(); m_pPropertiesTree->setHeaderLabels(tr("Key|Value|Type").split("|")); //m_pPropertiesTree->setSelectionMode(QAbstractItemView::ExtendedSelection); #ifdef WIN32 m_pPropertiesTree->setStyle(QStyleFactory::create("windowsxp")); #endif m_pPropertiesTree->setSortingEnabled(true); m_pPropertiesTree->setContextMenuPolicy(Qt::CustomContextMenu); connect(m_pPropertiesTree, SIGNAL(customContextMenuRequested( const QPoint& )), this, SLOT(OnMenuRequested(const QPoint &))); m_pMenu = new QMenu(); m_pAddRoot = new QAction(tr("Add to Root"), m_pMenu); connect(m_pAddRoot, SIGNAL(triggered()), this, SLOT(OnAddRoot())); m_pMenu->addAction(m_pAddRoot); m_pAdd = new QAction(tr("Add"), m_pMenu); connect(m_pAdd, SIGNAL(triggered()), this, SLOT(OnAdd())); m_pMenu->addAction(m_pAdd); m_pRemove = new QAction(tr("Remove"), m_pMenu); connect(m_pRemove, SIGNAL(triggered()), this, SLOT(OnRemove())); m_pMenu->addAction(m_pRemove); m_pMainLayout->addWidget(m_pPropertiesTree); if(bWithButtons) { m_pButtons = new QDialogButtonBox(QDialogButtonBox::Apply | QDialogButtonBox::Reset, Qt::Horizontal, this); QObject::connect(m_pButtons, SIGNAL(clicked(QAbstractButton *)), this, SLOT(OnClicked(QAbstractButton*))); m_pMainLayout->addWidget(m_pButtons); } else
void OnCommand( HWND hWnd, WPARAM wParam ) { switch( LOWORD(wParam) ) { case 1001: if( HIWORD(wParam)==CBN_SELCHANGE ) { HWND hSimple = GetDlgItem( hWnd, 1001 ); HWND hDropDown = GetDlgItem( hWnd, 1002 ); HWND hDropList = GetDlgItem( hWnd, 1003 ); LRESULT nSel = SendMessage( hSimple, CB_GETCURSEL, 0, 0 ); SendMessage(hDropDown,CB_SETCURSEL,nSel,0); SendMessage(hDropList,CB_SETCURSEL,nSel,0); }else if( HIWORD(wParam)==CBN_EDITCHANGE ) { MessageBox(hWnd,"键盘输入内容有变化","Infor", MB_OK ); } break; case ID_DATA: OnData( hWnd );//获取选择项的附加数据 break; case ID_TEXT: OnText( hWnd );//获取选择项文本内容 break; case ID_FIND: OnFind( hWnd );//匹配选项 break; case ID_DELETE: OnDelete( hWnd );//删除选择项 break; case ID_CLEAR: OnClear( hWnd );//清空选项 break; case ID_ADD: OnAdd( hWnd );//添加选项 break; } }
void OnCommand(HWND hWnd,WPARAM wParam){ switch(LOWORD(wParam)){ case 1001: if(HIWORD(wParam) == CBN_SELCHANGE){ HWND hSimple = GetDlgItem(hWnd,1001); HWND hDropDown = GetDlgItem(hWnd,1002); HWND hDropList = GetDlgItem(hWnd,1003); LRESULT nRet = SendMessage(hSimple,CB_GETCURSEL,0,0); SendMessage(hDropDown,CB_SETCURSEL,nRet,0); SendMessage(hDropList,CB_SETCURSEL,nRet,0); } else if(HIWORD(wParam) == CBN_EDITCHANGE ){ MessageBox(hWnd,"Keyboard Input changes","Info",MB_OK); } break; case ID_DATA: OnData(hWnd); break; case ID_DIR: OnDir(hWnd); break; case ID_TEXT: OnText(hWnd); break; case ID_FIND: OnFind(hWnd); break; case ID_ADD: OnAdd(hWnd); break; case ID_CLEAN: OnClean(hWnd); break; case ID_DELETE: OnDelete(hWnd); break; } }
void KUiFontManage::OnButtonClick(int nBtnId) { switch(nBtnId) { case IDC_WND_FONT_MANAGE_FONT_ADD: OnAdd(); break; case IDC_WND_FONT_MANAGE_FONT_CHANGE: OnChange(); break; case IDC_WND_FONT_MANAGE_FONT_SAVE: OnSave(m_szFontFileName); break; case IDC_WND_FONT_MANAGE_FONT_COLOR_SEL: OnChangeColor(0, 0); break; case IDC_WND_FONT_MANAGE_FONT_BCOLOR_SEL: OnChangeColor(1, 0); break; case IDC_WND_FONT_MANAGE_FONT_PCOLOR_SEL: OnChangeColor(2, 0); break; case IDC_WND_FONT_MANAGE_FONT_SEL: if (!m_bManage) { OnSave(m_szFontFileName); m_bSel = TRUE; PostMessage(m_hWnd, WM_CLOSE, 0, 0); } break; default: break; } }
/*------------------------------------------- dialog procedure ---------------------------------------------*/ INT_PTR CALLBACK DlgProcTimer(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_TIMERNAME: if(code == CBN_SELCHANGE) OnName(hDlg); else if(code == CBN_DROPDOWN) OnNameDropDown(hDlg); break; case IDC_TIMERADD: OnAdd(hDlg); break; case IDC_TIMERDEL: OnDelete(hDlg); break; case IDC_TIMERSANSHO: OnBrowse(hDlg); break; case IDC_TIMERTEST: OnTest(hDlg); break; 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_TIMERHELP: OnHelp(hDlg); break; } return TRUE; } // playing sound ended case MM_MCINOTIFY: case MM_WOM_DONE: if(message == MM_MCINOTIFY) OnMCINotify(hDlg, wParam, (LONG)lParam); else StopFile(); m_bPlaying = FALSE; SendDlgItemMessage(hDlg, IDC_TIMERTEST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_hIconPlay); return TRUE; case WM_DESTROY: OnDestroy(hDlg); break; } return FALSE; }
Adding::Adding(QWidget* parent) : QDialog(parent) { setFixedSize(300, 200); setWindowTitle("Add Income"); setModal(true); setAttribute(Qt::WA_DeleteOnClose); // QDateTime dateTime = QDateTime::currentDateTime(); // QString todaysdate = dateTime.toString(); categoryBox = new QComboBox(); categoryBox->addItem("FRIEND"); categoryBox->addItem("SALARY"); categoryBox->addItem("PENSION"); categoryBox->addItem("OTHER"); DateBox = new QComboBox(); DateBox->addItem("Jan"); DateBox->addItem("Feb"); DateBox->addItem("Mar"); DateBox->addItem("April"); DateBox->addItem("May"); DateBox->addItem("June"); DateBox->addItem("July"); DateBox->addItem("Aug"); DateBox->addItem("Sep"); DateBox->addItem("Oct"); DateBox->addItem("Nov"); DateBox->addItem("Dec"); DateDayBox = new QComboBox(); DateDayBox->addItem("1"); DateDayBox->addItem("2"); DateDayBox->addItem("3"); DateDayBox->addItem("4"); DateDayBox->addItem("5"); DateDayBox->addItem("6"); DateDayBox->addItem("7"); DateDayBox->addItem("8"); DateDayBox->addItem("9"); DateDayBox->addItem("10"); DateDayBox->addItem("11"); DateDayBox->addItem("12"); DateDayBox->addItem("13"); DateDayBox->addItem("14"); DateDayBox->addItem("15"); DateDayBox->addItem("16"); DateDayBox->addItem("17"); DateDayBox->addItem("18"); DateDayBox->addItem("19"); DateDayBox->addItem("20"); DateDayBox->addItem("21"); DateDayBox->addItem("22"); DateDayBox->addItem("23"); DateDayBox->addItem("24"); DateDayBox->addItem("25"); DateDayBox->addItem("26"); DateDayBox->addItem("27"); DateDayBox->addItem("28"); DateDayBox->addItem("29"); DateDayBox->addItem("30"); DateDayBox->addItem("31"); DateYearBox = new QComboBox(); DateYearBox->addItem("2010"); DateYearBox->addItem("2011"); DateYearBox->addItem("2012"); DateYearBox->addItem("2013"); DateYearBox->addItem("2014"); DateYearBox->addItem("2015"); DateYearBox->addItem("2016"); userDate = new QLabel("Date:"); userLineCat = new QLineEdit(); userCategory = new QLabel("Category:"); userLineCat = new QLineEdit(); userPrice = new QLabel("Price:"); userLinePrice = new QLineEdit(); userPayment = new QLabel("Payment Type:"); userLinePayment = new QLineEdit(); userDescription = new QLabel("Description:"); userLineDescription = new QLineEdit(); addButton = new QPushButton("ADD"); cancelButton = new QPushButton("CANCEL"); QVBoxLayout* vbox = new QVBoxLayout(this); QHBoxLayout* hbox1 = new QHBoxLayout(); QHBoxLayout* hbox2 = new QHBoxLayout(); QHBoxLayout* hbox3 = new QHBoxLayout(); QHBoxLayout* hbox4 = new QHBoxLayout(); QHBoxLayout* hbox5 = new QHBoxLayout(); QHBoxLayout* hbox6 = new QHBoxLayout(); hbox6 -> addWidget(addButton,1,Qt::AlignCenter); hbox6 -> addWidget(cancelButton,1,Qt::AlignCenter); hbox1 -> addWidget(userDate,1); hbox1 -> addWidget(DateBox,1); hbox1 -> addWidget(DateDayBox,1); hbox1 -> addWidget(DateYearBox,1); hbox2 -> addWidget(userCategory,1); hbox2 -> addWidget(categoryBox,3); hbox3 -> addWidget(userPrice,1); hbox3 -> addWidget(userLinePrice,3); hbox4 -> addWidget(userPayment,1); hbox4 -> addWidget(userLinePayment,3); hbox5 -> addWidget(userDescription,1); hbox5 -> addWidget(userLineDescription,3); vbox->addLayout(hbox1); vbox->addLayout(hbox5); vbox->addLayout(hbox2); vbox->addLayout(hbox3); vbox->addLayout(hbox4); vbox->addLayout(hbox6); vbox->setSpacing(15); connect(addButton, SIGNAL(clicked()), this, SLOT(OnAdd())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(OnCancel())); }
AddExpense::AddExpense(QWidget* parent) : QDialog(parent) { setFixedSize(300, 300); setWindowTitle("Add Expense"); setModal(true); setAttribute(Qt::WA_DeleteOnClose); QDateTime dateTime = QDateTime::currentDateTime(); QString todaysdate = dateTime.toString(); categoryBox = new QComboBox(); categoryBox->addItem("TRAVELLING"); categoryBox->addItem("FOOD"); categoryBox->addItem("SHOPPING"); categoryBox->addItem("EDUCATION"); categoryBox->addItem("RENT"); categoryBox->addItem("MEDICAL"); categoryBox->addItem("OTHER"); userDate = new QLabel("Date:"); todaysDate = new QLabel(todaysdate); userCategory = new QLabel("Category:"); userLineCat = new QLineEdit(); userPrice = new QLabel("Price:"); userLinePrice = new QLineEdit(); userPayment = new QLabel("Payment Type:"); userLinePayment = new QLineEdit(); addButton = new QPushButton("ADD"); cancelButton = new QPushButton("CANCEL"); QVBoxLayout* vbox = new QVBoxLayout(this); QHBoxLayout* hbox1 = new QHBoxLayout(); QHBoxLayout* hbox2 = new QHBoxLayout(); QHBoxLayout* hbox3 = new QHBoxLayout(); QHBoxLayout* hbox4 = new QHBoxLayout(); QHBoxLayout* hbox5 = new QHBoxLayout(); hbox1 -> addWidget(userDate,1); hbox1 -> addWidget(todaysDate,2); hbox2 -> addWidget(userCategory,1); hbox2 -> addWidget(categoryBox,2); //hbox2 -> addWidget(userLineCat,2); hbox3 -> addWidget(userPrice,1); hbox3 -> addWidget(userLinePrice,2); hbox4 -> addWidget(userPayment,1); hbox4 -> addWidget(userLinePayment,2); hbox5 -> addWidget(addButton,1,Qt::AlignCenter); hbox5 -> addWidget(cancelButton,2,Qt::AlignCenter); vbox->addLayout(hbox1); vbox->addLayout(hbox2); vbox->addLayout(hbox3); vbox->addLayout(hbox4); vbox->addLayout(hbox5); connect(addButton, SIGNAL(clicked()), this, SLOT(OnAdd())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(OnCancel())); }
/*------------------------------------------------ Dialog procedure --------------------------------------------------*/ INT_PTR CALLBACK PageMouseProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_INITDIALOG: OnInit(hDlg); return TRUE; case WM_DESTROY: OnDestroy(hDlg); break; case WM_COMMAND: { WORD id, code; id = LOWORD(wParam); code = HIWORD(wParam); switch(id) { case IDC_NAMECLICK: if(code == CBN_SELCHANGE) { m_bInit = FALSE; OnName(hDlg); m_bInit = TRUE; } else if(code == CBN_DROPDOWN) OnNameDropDown(hDlg); else if(code == CBN_EDITCHANGE) SendPSChanged(hDlg); break; case IDC_ADDCLICK: OnAdd(hDlg); break; case IDC_DELCLICK: OnDelete(hDlg); break; case IDC_MOUSEBUTTON: if(code == CBN_SELCHANGE) { #if TC_ENABLE_WHEEL OnMouseButton(hDlg); #endif SendPSChanged(hDlg); } break; case IDC_RADSINGLE: case IDC_RADDOUBLE: case IDC_RADTRIPLE: case IDC_RADQUADRUPLE: case IDC_MOUSECTRL: case IDC_MOUSESHIFT: case IDC_MOUSEALT: case IDC_RCLICKMENU: SendPSChanged(hDlg); break; case IDC_LMOUSEPASSTHRU: g_bApplyClock = TRUE; SendPSChanged(hDlg); break; case IDC_MOUSEFUNC: OnFunction(hDlg, TRUE); break; case IDC_MOUSEOPT: if(code == EN_CHANGE) SendPSChanged(hDlg); break; case IDC_MOUSEOPTSANSHO: OnBrowse(hDlg); break; } return TRUE; } case WM_NOTIFY: switch(((NMHDR *)lParam)->code) { case PSN_APPLY: OnApply(hDlg); break; case PSN_HELP: MyHelp(GetParent(hDlg), "Mouse"); break; } return TRUE; } return FALSE; }