void UIHelper::TestDlg2() { CAcModuleResourceOverride myResources; //非模态对话框(必须用new,否则会有内存错误) TestDialog* dlg = new TestDialog(acedGetAcadFrame(), FALSE); //关闭模态对话框后,会通过消息来删除内存 dlg->Run(); }
int main(int argc, char **argv) { QApplication app(argc, argv); TestDialog test; test.check(QString::fromLatin1("This is a sample buffer. Whih this thingg will " "be checkin for misstakes. Whih, Enviroment, govermant. Whih.") ); return app.exec(); }
int main( int argc, char** argv ) { //KApplication::disableAutoDcopRegistration(); KCmdLineArgs::init( argc, argv, "test_dialog", 0, ki18n("test_dialog"), 0); KApplication app; // with GUI TestDialog test; test.check( "This is a sample buffer. Whih this thingg will " "be checkin for misstakes. Whih, Enviroment, govermant. Whih." ); return app.exec(); }
int main(int argc, char *argv[]) { QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); QApplication a(argc, argv); int fontId = QFontDatabase::addApplicationFont("ztgj.ttf"); if(fontId >=0) { qDebug("font id:%d\n",fontId); QString msyh = QFontDatabase::applicationFontFamilies ( fontId ).at(0); QFont font(msyh,10); //将此字体设为QApplication的默认字体 QApplication::setFont(font); } TestDialog dialog; dialog.setWindowTitle("这是一段特别特别长的测试窗口标题栏文本的字符串"); dialog.exec(); return 0; }
int main(int argc, char* argv[]) { // Q_INIT_RESOURCE(flags); QApplication app(argc, argv); QTranslator trans; bool ok = trans.load(":/qxt_"+QLocale::system().name()); if (!ok) qDebug() << "Loading translation failed."; qDebug() << trans.translate("Country", "Germany"); app.installTranslator(&trans); TestDialog* w = new TestDialog(); w->show(); app.exec(); }
bool MyApp::OnInit() { // create the main application window // MyFrame1 *frame = new MyFrame1(NULL, 0, _T("AccessTest wxWidgets App"), // wxPoint(50, 50), wxSize(450, 340), 0); // frame->Show(true); wxBitmap bitmap; bitmap = wxBitmap(about_logo); //bool ok = frame->m_isPda // ? bitmap.Ok() // : bitmap.LoadFile(_T("splash.png"), wxBITMAP_TYPE_PNG); new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, 6000, NULL, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER); //wxSIMPLE_BORDER|wxSTAY_ON_TOP); wxYield(); TestDialog * mainWindow = new TestDialog(NULL); mainWindow->ShowModal(); //mainWindow->Destory(); // success: wxApp::OnRun() will be called which will enter the main message // loop and the application will run. If we returned false here, the // application would exit immediately. //wxMessageBox( _T("This sample has to be compiled with wxUSE_ACCESSIBILITY"), _T("Building error"), wxOK); return true; }
bool MyApp::OnInit() { // create the main application window // MyFrame1 *frame = new MyFrame1(NULL, 0, _T("AccessTest wxWidgets App"), // wxPoint(50, 50), wxSize(450, 340), 0); // frame->Show(true); TestDialog * mainWindow = new TestDialog(NULL); mainWindow->ShowModal(); //mainWindow->Destory(); // success: wxApp::OnRun() will be called which will enter the main message // loop and the application will run. If we returned false here, the // application would exit immediately. //wxMessageBox( _T("This sample has to be compiled with wxUSE_ACCESSIBILITY"), _T("Building error"), wxOK); return true; }
//-------------------------------------------------------------------------------------------- LRESULT CALLBACK TestDialog::_resultWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { TestDialog *pDialog = (TestDialog *)(LONG_PTR)::GetWindowLong(hWnd, GWL_USERDATA); switch(uMsg) { case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = ::BeginPaint(hWnd, &ps); RECT rect; ::GetClientRect(hWnd, &rect); HBRUSH hSolidBrush = ::CreateSolidBrush(GetSysColor(COLOR_3DFACE)); ::FillRect(hdc, &rect, hSolidBrush); switch(pDialog->m_resultState) { case 1: DrawIconEx(hdc, 0, 0, pDialog->m_hCheckMarkIcon, 48, 48, 0, NULL, DI_NORMAL); break; case 2: DrawIconEx(hdc, 0, 0, pDialog->m_hCrossMarkIcon, 48, 48, 0, NULL, DI_NORMAL); break; default: break; } DeleteObject(hdc); ::EndPaint(hWnd, &ps); return TRUE; } break; default: break; } return pDialog->m_resultWndProc(hWnd, uMsg, wParam, lParam); }
bool TestApp::OnInit() { TestDialog* dlg = new TestDialog( true ); dlg->ShowModal(); return false; }
void unitlession::on_pushTest_clicked() { TestDialog openTestDialog; openTestDialog.setModal(true); openTestDialog.exec(); }