Пример #1
0
MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent),
	ui(new Ui::MainWindow)
{
	fDoc = NULL;
	fEnableAutoBreakdown = true;
	fDefaultFps = 24;

	ui->setupUi(this);

	setAcceptDrops(true);

	ui->waveformView->SetScrollArea(ui->scrollArea);
	ui->fpsEdit->setValidator(new QIntValidator(1, 120));

    ui->exportChoice->addItem("Spine");

	connect(ui->actionZoomIn, SIGNAL(triggered()), ui->waveformView, SLOT(onZoomIn()));
	connect(ui->actionZoomOut, SIGNAL(triggered()), ui->waveformView, SLOT(onZoomOut()));
	connect(ui->actionAutoZoom, SIGNAL(triggered()), ui->waveformView, SLOT(onAutoZoom()));
	connect(ui->fpsEdit, SIGNAL(textChanged(QString)), this, SLOT(onFpsChange(QString)));
	connect(ui->waveformView, SIGNAL(frameChanged(int)), ui->mouthView, SLOT(onFrameChanged(int)));

	RestoreSettings();
	updateActions();
}
Пример #2
0
void main(void) //using 0
{			   
	EA = 0;
	
	
	PLLCON&=PLLCON_VAL;//настройка частоты процессора
	
	RestoreCalibrate();
	RestoreSettings();
//	ChannelsInit();//инициализация настроек каналов
	Protocol_Init();	
	Timer1_Initialize(); //таймер шедулера 200Гц	
	ADC_Initialize();
	UART_Init();


	WDT_Init(WDT_2000);//включить сторожевой таймер

	PT_INIT(&pt_sort);

	startMenu();
	EA=1;


	while(1)
	{		
		ulongsort_process(&pt_sort);
		DisplayProcess(&pt_display);  
		WDT_Process(&pt_wdt);
		KeyboardProcess(&pt_keyboard);	    
	}
}
Пример #3
0
long NewtonDemos::onLoad(FXObject* sender, FXSelector id, void* eventPtr)
{
	BEGIN_MENU_OPTION();

	const FXchar patterns[]="Newton Dynamics Files (*.ngd)";
	FXFileDialog open(this,"Load Newton Dynamics scene");
	open.setPatternList(patterns);
	open.setDirectory ("../../../media");
	if(open.execute()){

		m_scene->Cleanup();

		// load the scene from a ngd file format
		m_scene->makeCurrent();
		m_scene->LoadScene (open.getFilename().text());
		m_scene->makeNonCurrent();

		// add a sky box to the scene, make the first object
		m_scene->Addtop (new SkyBox());

		// place camera into position
		dMatrix camMatrix (GetIdentityMatrix());
		//		camMatrix.m_posit = dVector (-40.0f, 10.0f, 0.0f, 0.0f);
		camMatrix = dYawMatrix(-0.0f * 3.1416f / 180.0f);
		camMatrix.m_posit = dVector (-5.0f, 1.0f, -0.0f, 0.0f);
		m_scene->SetCameraMatrix(camMatrix, camMatrix.m_posit);

		RestoreSettings ();
	}


	m_scene->ResetTimer();
	END_MENU_OPTION();
	return 1;
}
Пример #4
0
void NewtonDemos::OnNew (wxCommandEvent& event)
{
	BEGIN_MENU_OPTION();
	m_scene->Cleanup();
	RestoreSettings ();
	m_scene->ResetTimer();
	END_MENU_OPTION();
}
Пример #5
0
BOOL RestorePreferences (LPIDENT lpi, void *pData, size_t cbData)
{
   TCHAR szPath[ MAX_PATH ];
   WORD wVer;

   if (!GetPreferencesInfo (lpi, szPath, &wVer))
      return FALSE;

   return RestoreSettings (REGSTR_SETTINGS_BASE, szPath, SETTINGS_KW, pData, cbData, wVer);
}
Пример #6
0
PWSGridTable::PWSGridTable(PWSGrid* pwsgrid) : m_pwsgrid(pwsgrid)
{
  //PWSGridTable could be created many times, but the above table should be initialized
  //only once to avoid losing the changes made during a session
  static bool initialized = false;
  if (!initialized) {
    RestoreSettings();
    initialized = true;
  }
}
Пример #7
0
void NewtonDemos::OnRunDemo(wxCommandEvent& event)
{
	BEGIN_MENU_OPTION();

	wxMenu* const menu = m_mainMenu->GetMenu(m_mainMenu->FindMenu(_ ("Demos")));
	if (!menu->IsChecked(event.GetId())) {
		menu->Check (event.GetId(), true);
	}

	LoadDemo (event.GetId() - ID_RUN_DEMO);

	RestoreSettings ();
	END_MENU_OPTION();
}
Пример #8
0
void NewtonDemos::OnDeserializeWorld(wxCommandEvent& event)
{
	BEGIN_MENU_OPTION();

	wxFileDialog save (this, wxT("Import a Newton Dynamics Serialized Physics Scene"), wxT("../../../media"), wxT(""), wxT("*.bin"));
	if (save.ShowModal() == wxID_OK) {
		wxString currentDocPath (save.GetPath());
		//m_scene->DeserializedPhysicScene (currentDocPath.c_str());
		m_scene->DeserializedPhysicScene (currentDocPath.mb_str());
		RestoreSettings ();
	}

	m_scene->ResetTimer();
	END_MENU_OPTION();
}
Пример #9
0
void NewtonDemos::LoadDemo (int index)
{
	BEGIN_MENU_OPTION();

	m_scene->Cleanup();
    
	m_demosSelection[index].m_launchDemoCallback (m_scene);
	m_scene->SwapBuffers(); 

	RestoreSettings ();
	m_scene->ResetTimer();

	// clean up all caches the engine have saved
	NewtonInvalidateCache(m_scene->GetNewton());

	END_MENU_OPTION();
}
Пример #10
0
INT_PTR CALLBACK DialogProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
	case WM_INITDIALOG:
		{
			HICON hIcon=(HICON)LoadImage(hInst,MAKEINTRESOURCE(IDI_SETTINGSTOOL),IMAGE_ICON,32,32,LR_SHARED);
			//SetIcon(hWnd,hIcon,TRUE);
			SetClassLongPtr(hWnd,GCLP_HICON,(LONG_PTR)hIcon);
			hIcon=(HICON)LoadImage(hInst,MAKEINTRESOURCE(IDI_SETTINGSTOOL),IMAGE_ICON,16,16,LR_SHARED);
			//SetIcon(hWnd,hIcon,FALSE);
			SetClassLongPtr(hWnd,GCLP_HICONSM,(LONG_PTR)hIcon);
			break;
		}
	case WM_COMMAND:
		switch (LOWORD(wParam))
		{
		case IDOK:
			break;
		case IDCANCEL:
			EndDialog(hWnd,0);
			break;
		case IDC_SAVESETTINGS:
			SaveSettings(hWnd);
			break;
		case IDC_RESTORESETTINGS:
			RestoreSettings(hWnd);
			break;
		case IDC_REMOVESETTINGS:
			RemoveSettings(hWnd);
			break;
		default:
			return DefDlgProc(hWnd, message, wParam, lParam);
		}
		break;
	case WM_CLOSE:
		EndDialog(hWnd,0);
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	//default:
		//return DefDlgProc(hWnd, message, wParam, lParam);
	}
	return 0;
}
Пример #11
0
void TestMRUHelper::tearDownSuite()
{
	RestoreSettings(L"OriginalDocumentMRU", m_origMRU);
	RestoreSettings(L"ModifiedDocumentMRU", m_modMRU);
}
Пример #12
0
			RegexpMatcherManager::RegexpMatcherManager ()
			: SaveScheduled_ (false)
			{
				ItemHeaders_ << tr ("Title matcher") << tr ("Body extractor");
				RestoreSettings ();
			}
Пример #13
0
INT main ( int argc, char **argv )
{
   ULONG    ulFlags;
   QMSG     qmMsg;
   HMQ      hmqQueue;
   HWND     hwndFrame;
   HWND     hwndClient;
   CHAR     szAppClass[MAX_STRING_BYTES];


   /*
    * Copy the fully-qualified executable filename into szExecFile.
    */

   strcpy( szExecFile, argv[0] );

   /*
    * Get the anchor block and initialize the message queue
    */

   habAnchor = WinInitialize ( 0 ) ;
   hmqQueue = WinCreateMsgQueue ( habAnchor, 0 ) ;

   /*
    * Run the initialization routines on all other modules.
    */

   h2cursor_init();
   h2edit_init();
   h2file_init();
   h2font_init();
   h2help_init();
   h2reg_init();
   h2screen_init();
   h2search_init();

   /*
    * Register the client window class name and window procedure.  Make the class
    * name the same as the application name.
    */

   strncpy( szAppClass, szAppName, MAX_STRING_BYTES );

   WinRegisterClass ( habAnchor,
                      szAppClass,
                      ClientWndProc,
                      CS_SIZEREDRAW,
                      0 ) ;

   /*
    * Create a standard window with vertical and horizontal scroll bars.  Keep it
    * invisible for now.
    */

   ulFlags = FCF_STANDARD | FCF_VERTSCROLL | FCF_HORZSCROLL;

   hwndFrame = WinCreateStdWindow ( HWND_DESKTOP,
                                    0,    /// WS_VISIBLE,
                                    &ulFlags,
                                    szAppClass,
                                    szAppName,
                                    0,
                                    NULLHANDLE,
                                    RES_CLIENT,
                                    &hwndClient ) ;

   /*
    * If frame creation was successful, proceed with the remainder
    * of the window startup tasks.
    */

   if ( hwndFrame != NULLHANDLE )
   {
      /*
       * Restore the window settings (if any) and display the window.
       */

      if ( RestoreSettings( hwndClient, habAnchor ) )
      {
         UpdateScreenLimits( hwndClient, TRUE );
      }

      DisplayAboutPanel( hwndClient, 2 );
      WinSetWindowPos( hwndFrame, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE | SWP_SHOW );

      /*
       * Create a help instance.
       */

      CreateHelpInstance( habAnchor, hwndFrame, szExecFile );

      /*
       * If anything was specified on the command line, treat it as a file and
       * read it in.
       */

      if ( argc > 1 )
      {
         if ( FileOpenDialog( hwndClient, argv[1] ) )
         {
            SetWindowTitle( hwndClient );
            UpdateScreenLimits( hwndClient, TRUE );
         }
      }

      /*
       * Do the get message/dispatch message loop until done (WM_QUIT
       * posted to the message queue).
       */

      while ( WinGetMsg( habAnchor, &qmMsg, NULLHANDLE, 0, 0 ) )
         WinDispatchMsg ( habAnchor, &qmMsg );

      /*
       * Destroy the help instance.
       */

      DestroyHelpInstance();

      /*
       * And destroy the frame window (and all child windows).
       */

      WinDestroyWindow ( hwndFrame ) ;
   }

   /*
    * Cleanup - destroy the message queue, release the anchor block, and return.
    */

   WinDestroyMsgQueue ( hmqQueue ) ;
   WinTerminate ( habAnchor ) ;
   return 0 ;
}
Пример #14
0
BOOL InitApplication (HINSTANCE hInst, LPTSTR pszCmdLine, int nCmdShow)
{
   TaLocale_LoadCorrespondingModule (hInst);

   memset (&g, 0x00, sizeof(g));
   g.hInst = hInst;
   g.hAccel = TaLocale_LoadAccelerators (ACCEL_MAIN);

   HWND hPrevious;
   TCHAR szTitle[ cchRESOURCE ];
   GetString (szTitle, IDS_APP_TITLE);
   if ((hPrevious = FindWindow (TEXT("AFSAccountManagerClass"), szTitle)) != NULL)
      {
      SetFocus (hPrevious);
      SendMessage (hPrevious, WM_SHOW_YOURSELF, 0, 0);
      return FALSE;
      }

   AfsAppLib_SetAppName(szTitle);
   AfsAppLib_SetPumpRoutine(PumpMessage);

   TASKQUEUE_PARAMS tqp;
   memset (&tqp, 0x00, sizeof(tqp));
   tqp.nThreadsMax = 10;
   tqp.fnCreateTaskPacket = CreateTaskPacket;
   tqp.fnPerformTask = PerformTask;
   tqp.fnFreeTaskPacket = FreeTaskPacket;
   AfsAppLib_InitTaskQueue (&tqp);

   Main_ConfigureHelp();

   // Determine how the app is supposed to look--that is, remember what it
   // looked like last time, and if there was no "last time", pick some
   // decent defaults.
   //
   if (!RestoreSettings (REGSTR_SETTINGS_BASE, REGSTR_SETTINGS_PATH, REGVAL_SETTINGS, &gr, sizeof(gr), wVerGLOBALS_RESTORED))
      {
      memset (&gr, 0x00, sizeof(gr));
      SetRectEmpty (&gr.rMain);
      gr.cminRefreshRate = 60; // 1 hour default refresh rate

      User_SetDefaultCreateParams (&gr.CreateUser);
      Group_SetDefaultCreateParams (&gr.CreateGroup);
      Machine_SetDefaultCreateParams (&gr.CreateMachine);
      Actions_SetDefaultView (&gr.viewAct);
      User_SetDefaultView (&gr.viewUsr, &gr.ivUsr);
      Group_SetDefaultView (&gr.viewGrp, &gr.ivGrp);
      Machine_SetDefaultView (&gr.viewMch, &gr.ivMch);
      Users_SetDefaultSearchParams (&gr.SearchUsers);
      }

   // Create a variation on WC_DIALOG, so we get appropriate icons on
   // our windows.
   //
   WNDCLASS wc;
   GetClassInfo (THIS_HINST, MAKEINTRESOURCE( WC_DIALOG ), &wc);
   wc.hInstance = THIS_HINST;
   wc.hIcon = TaLocale_LoadIcon (IDI_MAIN);
   wc.lpszClassName = TEXT("AFSAccountManagerClass");
   wc.style |= CS_GLOBALCLASS;
   RegisterClass (&wc);

   // Okay, the big step: create the main window.  Note that it doesn't
   // get shown yet!
   //
   CMDLINEOP op = ParseCommandLine (pszCmdLine);
   if (op == opCLOSEAPP)
      return FALSE;

   // Okay, the big step: create the main window.
   // Note that it doesn't get shown yet!
   //
   g.hMain = ModelessDialog (IDD_MAIN, NULL, (DLGPROC)Main_DialogProc);
   if (g.hMain == NULL)
      return FALSE;

   if (op != opNOCELLDIALOG)
      {
      if (OpenCellDialog() != IDOK)
         return FALSE;
      }

   return TRUE;
}
Пример #15
0
MainWindow::MainWindow(QWidget *parent) :
	QDialog(parent),
	ui(new Ui::MainWindow)
{
	ui->setupUi(this);

	ui->fEditor->setAcceptRichText(false);

	fSimpleNote = 0;

	ui->fNoteList->setItemDelegate(new ListDelegate(ui->fNoteList));
	ui->fTagsComboBox->view()->setItemDelegate(new TagListDelegate(ui->fTagsComboBox));


	QList<int> sizes;
	sizes << 200 << 400;

	ui->fSplitter->setSizes(sizes);
	fTimer = new QTimer(this);
	fTimer->setInterval(5000);
	fTimer->start();
	connect(fTimer, SIGNAL(timeout()), this, SLOT(OnTimeout()));


	QAction* quitAction = new QAction(tr("Quit"), this);
	quitAction->setShortcut(QKeySequence("Ctrl+Q"));
	connect(quitAction, SIGNAL(triggered(bool)), this, SLOT(close()));
	addAction(quitAction);


	QAction* addNoteAction = new QAction(tr("New Note"), this);
	addNoteAction->setIcon(QIcon(":/images/images/add2.png"));
	addNoteAction->setShortcut(QKeySequence("Ctrl+N"));
	connect(addNoteAction, SIGNAL(triggered(bool)), this, SLOT(OnAdd()));
	ui->fNoteList->addAction(addNoteAction);

	ui->fAddButton->setDefaultAction(addNoteAction);


	QAction* deleteCurrent = new QAction(tr("Remove"), ui->fNoteList);
	deleteCurrent->setIcon(QIcon(":/images/images/delete2.png"));
	connect(deleteCurrent, SIGNAL(triggered(bool)), this, SLOT(RemoveCurrent()));
	ui->fNoteList->addAction(deleteCurrent);
	ui->fNoteList->setContextMenuPolicy(Qt::ActionsContextMenu);


	QAction* syncCurrentAction = new QAction("Sync Current", this);
	syncCurrentAction->setShortcut(QKeySequence("Ctrl+S"));
	connect(syncCurrentAction, SIGNAL(triggered(bool)), this, SLOT(SaveCurrent()));
	addAction(syncCurrentAction);

	QAction* syncAction = new QAction("Full Sync", this);
	syncAction->setShortcut(QKeySequence("Ctrl+Shift+S"));
	connect(syncAction, SIGNAL(triggered(bool)), this, SLOT(FullSync()));
	addAction(syncAction);

	QAction* tagsAction = new QAction("Edit Tags", this);
	tagsAction->setShortcut(QKeySequence("Ctrl+G"));
	connect(tagsAction, SIGNAL(triggered(bool)), this, SLOT(EditTags()));
	addAction(tagsAction);

	QAction* settingsAction = new QAction("Settings...", this);
	connect(settingsAction, SIGNAL(triggered(bool)), this, SLOT(OnSettings()));
	addAction(settingsAction);

	ui->fSettingsButton->addAction(syncCurrentAction);
	ui->fSettingsButton->addAction(syncAction);
	ui->fSettingsButton->addAction(settingsAction);
	ui->fSettingsButton->setPopupMode(QToolButton::InstantPopup);


	connect(ui->fFavouriteButton, SIGNAL(clicked(bool)), this, SLOT(OnFavourite()));


	connect(ui->fEditor, SIGNAL(textChanged()), this, SLOT(OnTextChanged()));
	connect(ui->fSearchEdit, SIGNAL(textChanged(QString)), this, SLOT(OnSearchChanged()));
	connect(ui->fTagsEdit, SIGNAL(textChanged(QString)), this, SLOT(OnTagsChanged()));
	connect(ui->fExportButton, SIGNAL(clicked(bool)), this, SLOT(OnExport()));
	connect(ui->fTagsComboBox, SIGNAL(activated(int)), this, SLOT(OnTagSelected()));
	connect(ui->fEditor, SIGNAL(OpenNote(QString)), this, SLOT(OpenNote(QString)));

	fCurrent = -1;

	fNotes.SetMessageReceiver(this);

	fSnippets.reset(new SnippetCollection);
	ui->fEditor->SetSnippets(fSnippets);

	fNotesModel = new NoteListModel(&fNotes, this);
	fFilterModel = new NoteSortFilterModel(this);
	fFilterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
	fFilterModel->setSortCaseSensitivity(Qt::CaseInsensitive);
	fFilterModel->setSourceModel(fNotesModel);

	ui->fNoteList->setModel(fFilterModel);

	connect(ui->fNoteList->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(OnSelection(QModelIndex)));

	LoadNotes();
	UpdateNoteList();

	ui->fNoteList->setCurrentIndex(fFilterModel->index(0, 0));
	ui->fNoteList->setFocus();

	RestoreSettings();
	SetEditorFont(SettingsDialog::CurrentFont(), SettingsDialog::CurrentTabSize());
}
Пример #16
0
dlgSearchObject::dlgSearchObject(frmMain *p, pgDatabase *db, pgObject *obj)
{
	parent = p;
	header = wxT("");
	currentdb = db;

	SetFont(settings->GetSystemFont());
	LoadResource(p, wxT("dlgSearchObject"));
	statusBar = XRCCTRL(*this, "unkStatusBar", wxStatusBar);

	// Icon
	appearanceFactory->SetIcons(this);
	RestorePosition();

	ToggleBtnSearch(false);

	lcResults->InsertColumn(0, _("Type"));
	lcResults->InsertColumn(1, _("Name"));
	lcResults->InsertColumn(2, _("Path"));

	// Mapping table between local language and english,
	// because in SQL we're using only english and translate it later
	// to the local language.

	aMap[_("All types")] = wxT("All types");
	aMap[_("Schemas")] = wxT("Schemas");
	aMap[_("Tables")] = wxT("Tables");
	aMap[_("Columns")] = wxT("Columns");
	aMap[_("Triggers")] = wxT("Triggers");
	aMap[_("Views")] = wxT("Views");
	aMap[_("Rules")] = wxT("Rules");
	aMap[_("Indexes")] = wxT("Indexes");
	aMap[_("Functions")] = wxT("Functions");
	aMap[_("Aggregates")] = wxT("Aggregates");
	aMap[_("Trigger Functions")] = wxT("Trigger Functions");
	aMap[_("Constraints")] = wxT("Constraints");
	aMap[_("Sequences")] = wxT("Sequences");
	aMap[_("Types")] = wxT("Types");
	aMap[_("Domains")] = wxT("Domains");
	aMap[_("Languages")] = wxT("Languages");
	aMap[_("Conversions")] = wxT("Conversions");
	aMap[_("Casts")] = wxT("Casts");
	aMap[_("Login Roles")] = wxT("Login Roles");
	aMap[_("Group Roles")] = wxT("Group Roles");
	aMap[_("FTS Configurations")] = wxT("FTS Configurations");
	aMap[_("FTS Dictionaries")] = wxT("FTS Dictionaries");
	aMap[_("FTS Parsers")] = wxT("FTS Parsers");
	aMap[_("FTS Templates")] = wxT("FTS Templates");
	aMap[_("Foreign Data Wrappers")] = wxT("Foreign Data Wrappers");
	aMap[_("Foreign Servers")] = wxT("Foreign Servers");
	aMap[_("Foreign Tables")] = wxT("Foreign Tables");
	aMap[_("User Mappings")] = wxT("User Mappings");
	aMap[_("Operators")] = wxT("Operators");
	aMap[_("Operator Classes")] = wxT("Operator Classes");
	aMap[_("Operator Families")] = wxT("Operator Families");
	aMap[_("Extensions")] = wxT("Extensions");
	aMap[_("Collations")] = wxT("Collations");

	cbType->Clear();
	cbType->Append(_("All types"));
	cbType->Append(_("Schemas"));
	cbType->Append(_("Tables"));
	cbType->Append(_("Columns"));
	cbType->Append(_("Triggers"));
	cbType->Append(_("Views"));
	cbType->Append(_("Rules"));
	cbType->Append(_("Indexes"));
	cbType->Append(_("Functions"));
	cbType->Append(_("Aggregates"));
	cbType->Append(_("Trigger Functions"));
	cbType->Append(_("Constraints"));
	cbType->Append(_("Sequences"));
	cbType->Append(_("Types"));
	cbType->Append(_("Languages"));
	cbType->Append(_("Domains"));
	cbType->Append(_("Conversions"));
	cbType->Append(_("Casts"));
	cbType->Append(_("Login Roles"));
	cbType->Append(_("Group Roles"));
	cbType->Append(_("FTS Configurations"));
	cbType->Append(_("FTS Dictionaries"));
	cbType->Append(_("FTS Parsers"));
	cbType->Append(_("FTS Templates"));
	if(currentdb->BackendMinimumVersion(8, 4))
	{
		cbType->Append(_("Foreign Data Wrappers"));
		cbType->Append(_("Foreign Servers"));
		cbType->Append(_("User Mappings"));
	}
	if(currentdb->BackendMinimumVersion(9, 1))
	{
		cbType->Append(_("Foreign Tables"));
	}
	cbType->Append(_("Operators"));
	cbType->Append(_("Operator Classes"));
	cbType->Append(_("Operator Families"));

	if(currentdb->BackendMinimumVersion(9, 1))
	{
		cbType->Append(_("Extensions"));
		cbType->Append(_("Collations"));
	}

	cbSchema->Clear();
	cbSchema->Append(_("All schemas"));
	cbSchema->Append(_("My schemas"));

	if (obj->GetSchema()) {
		if (obj->GetSchema()->GetSchema())
			currentSchema = obj->GetSchema()->GetSchema()->GetName();
		else
			currentSchema = obj->GetSchema()->GetName();
	}
	else if (obj->GetMetaType() == PGM_SCHEMA && !obj->IsCollection())
		currentSchema = obj->GetName();
	else
		currentSchema = wxEmptyString;

	if (!currentSchema.IsEmpty())
		cbSchemaIdxCurrent = cbSchema->Append(wxString::Format(_("Current schema (%s)"), currentSchema.c_str()));

	wxString sql;

	sql = wxT("SELECT nsp.nspname")
	      wxT("  FROM pg_namespace nsp\n");
	if (!settings->GetShowSystemObjects())
	{
		if (currentdb->BackendMinimumVersion(8, 1))
			sql += wxT(" WHERE nspname NOT LIKE E'pg\\\\_temp\\\\_%' AND nspname NOT LIKE E'pg\\\\_toast%'");
		else
			sql += wxT(" WHERE nspname NOT LIKE 'pg\\\\_temp\\\\_%' AND nspname NOT LIKE 'pg\\\\_toast%'");
	}
	sql += wxT(" ORDER BY nspname");

	pgSet *set = currentdb->GetConnection()->ExecuteSet(sql);
	if(set)
	{
		while(!set->Eof())
		{
			cbSchema->Append(set->GetVal(wxT("nspname")));
			set->MoveNext();
		}
		delete set;
	}

	RestoreSettings();
	txtPattern->SetFocus();
}
Пример #17
0
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	int home, away, timecode;
	char buf[BUFLEN];

	switch(uMsg)
	{
		case WM_DESTROY:
			// Exit the application when the window closes
			PostQuitMessage(1);
			return true;

		case WM_COMMAND:
			if (HIWORD(wParam) == BN_CLICKED)
			{
				if ((HWND)lParam == g_saveButtonControl)
				{
					SaveSettings();
					// modify status text
					SendMessage(g_statusTextControl, WM_SETTEXT, 0, (LPARAM)"SAVED");
				}
				else if ((HWND)lParam == g_restoreButtonControl)
				{
					RestoreSettings();
					// modify status text
					SendMessage(g_statusTextControl, WM_SETTEXT, 0, (LPARAM)"RESTORED");
				}
			}
			else if (HIWORD(wParam) == EN_CHANGE)
			{
				HWND control = (HWND)lParam;
				// modify status text
				SendMessage(g_statusTextControl, WM_SETTEXT, 0, (LPARAM)"CHANGES MADE");
			}
			else if (HIWORD(wParam) == CBN_EDITCHANGE)
			{
				HWND control = (HWND)lParam;
				// modify status text
				SendMessage(g_statusTextControl, WM_SETTEXT, 0, (LPARAM)"CHANGES MADE");
			}
			break;

		case WM_APP_KEYDEF:
			HWND target = (HWND)lParam;
			ZeroMemory(buf, BUFLEN);
			GetKeyNameText(MapVirtualKey(wParam, 0) << 16, buf, BUFLEN);
			SendMessage(target, WM_SETTEXT, 0, (LPARAM)buf);
			SendMessage(g_statusTextControl, WM_SETTEXT, 0, (LPARAM)"CHANGES MADE");
			// update config
			if (target == g_keySwitchLeftControl) g_keyCfg.keyboard.keySwitchLeft = (WORD)wParam;
			else if (target == g_keySwitchRightControl) g_keyCfg.keyboard.keySwitchRight = (WORD)wParam;
			else if (target == g_keyResetControl) g_keyCfg.keyboard.keyReset = (WORD)wParam;
			else if (target == g_keyRandomControl) g_keyCfg.keyboard.keyRandom = (WORD)wParam;
			else if (target == g_keyPrevControl) g_keyCfg.keyboard.keyPrev = (WORD)wParam;
			else if (target == g_keyNextControl) g_keyCfg.keyboard.keyNext = (WORD)wParam;
			else if (target == g_keyPrevValControl) g_keyCfg.keyboard.keyPrevVal = (WORD)wParam;
			else if (target == g_keyNextValControl) g_keyCfg.keyboard.keyNextVal = (WORD)wParam;
			else if (target == g_keyInfoPagePrevControl) g_keyCfg.keyboard.keyInfoPagePrev = (WORD)wParam;
			else if (target == g_keyInfoPageNextControl) g_keyCfg.keyboard.keyInfoPageNext = (WORD)wParam;
			else if (target == g_keyAction1Control) g_keyCfg.keyboard.keyAction1 = (WORD)wParam;
			else if (target == g_keyAction1Control) g_keyCfg.keyboard.keyAction2 = (WORD)wParam;
			else if (target == g_keySwitch1Control) g_keyCfg.keyboard.keySwitch1 = (WORD)wParam;
			else if (target == g_keySwitch1Control) g_keyCfg.keyboard.keySwitch2 = (WORD)wParam;
			break;
	}
	return DefWindowProc(hwnd,uMsg,wParam,lParam);
}
Пример #18
0
BOOL InitApplication (HINSTANCE hInst, LPTSTR pszCmdLine, int nCmdShow)
{
   TaLocale_LoadCorrespondingModule (hInst);

   memset (&g, 0x00, sizeof(g));
   g.hInst = hInst;
   g.hAccel = TaLocale_LoadAccelerators (ACCEL_MAIN);

   HWND hPrevious;
   TCHAR szTitle[ cchRESOURCE ];
   GetString (szTitle, IDS_APP_TITLE);
   if ((hPrevious = FindWindow (TEXT("AFSManagerClass"), szTitle)) != NULL)
      {
      SetFocus (hPrevious);
      SendMessage (hPrevious, WM_SHOW_YOURSELF, 0, 0);
      return FALSE;
      }

   AfsAppLib_SetAppName(szTitle);
   AfsAppLib_SetPumpRoutine(PumpMessage);

   TASKQUEUE_PARAMS tqp;
   memset (&tqp, 0x00, sizeof(tqp));
   tqp.nThreadsMax = 10;
   tqp.fnCreateTaskPacket = CreateTaskPacket;
   tqp.fnPerformTask = PerformTask;
   tqp.fnFreeTaskPacket = FreeTaskPacket;
   AfsAppLib_InitTaskQueue (&tqp);

   Main_ConfigureHelp();

   // Determine how the app is supposed to look--that is, remember what it
   // looked like last time, and if there was no "last time", pick some
   // decent defaults.
   //
   if (!RestoreSettings (REGSTR_SETTINGS_BASE, REGSTR_SETTINGS_PATH, REGVAL_SETTINGS, &gr, sizeof(gr), wVerGLOBALS_RESTORED))
      {
      memset (&gr, 0x00, sizeof(gr));
      SetRectEmpty (&gr.rMain);
      SetRectEmpty (&gr.rMainPreview);
      SetRectEmpty (&gr.rServerLast);
      SetRectEmpty (&gr.rViewLog);
      SetRectEmpty (&gr.rActions);

      gr.fPreview = TRUE;
      gr.fVert = TRUE;
      gr.fActions = FALSE;

      gr.tabLast = tabFILESETS;

      Server_SetDefaultView_Horz (&gr.diHorz.viewSvr);
      Server_SetDefaultView_Vert (&gr.diVert.viewSvr);
      Services_SetDefaultView (&gr.viewSvc);
      Aggregates_SetDefaultView (&gr.viewAgg);
      Filesets_SetDefaultView (&gr.viewSet);
      Replicas_SetDefaultView (&gr.viewRep);
      Action_SetDefaultView (&gr.viewAct);
      Server_Key_SetDefaultView (&gr.viewKey);

      gr.diHorz.cSplitter = -100;
      gr.diVert.cSplitter = -89;

      gr.cbQuotaUnits = cb1KB;

      gr.fOpenMonitors = TRUE;
      gr.fCloseUnmonitors = TRUE;
      gr.fServerLongNames = FALSE;
      gr.fDoubleClickOpens = 2;
      gr.fWarnBadCreds = TRUE;

      gr.ivSvr = ivSTATUS;
      gr.ivAgg = ivSTATUS;
      gr.ivSet = ivSTATUS;
      gr.ivSvc = ivSTATUS;
      }

   ULONG status;
   if (!AfsClass_Initialize (&status))
      {
      if (status == ADMCLIENTCANTINITAFSLOCATION)
         ImmediateErrorDialog (status, IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL);
      else
         ImmediateErrorDialog (status, IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN);
      return FALSE;
      }

   AfsClass_RequestLongServerNames (gr.fServerLongNames);
   AfsClass_SpecifyRefreshDomain (AFSCLASS_WANT_VOLUMES);

   // Create a notification object for the AFSClass library, so that it can
   // let us know when anything changes.  The notification handler we'll
   // install will take requests from the rest of the SVRMGR package and
   // forward notifications around to whichever windows are actually
   // interested.
   //
   CreateNotificationDispatch();

   // Create a few variations on WC_DIALOG, so we get appropriate icons on
   // our windows.
   //
   WNDCLASS wc;
   GetClassInfo (THIS_HINST, MAKEINTRESOURCE( WC_DIALOG ), &wc);
   wc.hInstance = THIS_HINST;
   wc.hIcon = TaLocale_LoadIcon (IDI_MAIN);
   wc.lpszClassName = TEXT("AFSManagerClass");
   wc.style |= CS_GLOBALCLASS;
   RegisterClass (&wc);

   GetClassInfo (THIS_HINST, MAKEINTRESOURCE( WC_DIALOG ), &wc);
   wc.hInstance = THIS_HINST;
   wc.hIcon = TaLocale_LoadIcon (IDI_SERVER);
   wc.lpszClassName = TEXT("ServerWindowClass");
   wc.style |= CS_GLOBALCLASS;
   RegisterClass (&wc);

   // Okay, the big step: create the main window (ie, the servers list).
   // Note that it doesn't get shown yet!
   //
   CMDLINEOP op = ParseCommandLine (pszCmdLine);
   if (op == opCLOSEAPP)
      return FALSE;

   if (op == opLOOKUPERRORCODE)
      {
      Help_FindError();
      return FALSE;
      }

   g.hMain = ModelessDialog (IDD_MAIN, NULL, (DLGPROC)Main_DialogProc);
   if (g.hMain == NULL)
      return FALSE;

   if (op != opNOCELLDIALOG)
      {
      if (OpenCellDialog() != IDOK)
         return FALSE;
      }

   return TRUE;
}