Esempio n. 1
0
void MAS::Window::HandleEvent(MAS::Widget &obj, int msg, intptr_t arg1, intptr_t arg2) {
   Dialog::HandleEvent(obj, msg, arg1, arg2);

   if (msg == MSG_ACTIVATE) {
      if (obj == iconMin) {
         Minimize();
      }
      else if (obj == iconMax) {
         Maximize();
      }
   }
   else if (msg == MSG_DCLICK) {
      if (obj == bGrip || obj == textBack || obj == title) {
         if (TestFlag(D_RESIZABLE)) {
            if (extraFlags & W_MAXIMIZED) {
               PlaySample(Skin::SAMPLE_CLOSE);
            }
            else {
               PlaySample(Skin::SAMPLE_OPEN);
            }
            Maximize();
         }
      }
   }
   else if (msg == MSG_CLOSE && obj == *clientArea) {
      Close();
   }
}
Esempio n. 2
0
// Formerly known as LoadRazorPrefs()
bool CamuleDlg::LoadGUIPrefs(bool override_pos, bool override_size)
{
	// Create a config base for loading razor preferences
	wxConfigBase *config = wxConfigBase::Get();
	// If config haven't been created exit without loading
	if (config == NULL) {
		return false;
	}

	// The section where to save in in file
	wxString section = wxT("/Razor_Preferences/");

	// Get window size and position
	int x1 = config->Read(section + wxT("MAIN_X_POS"), -1);
	int y1 = config->Read(section + wxT("MAIN_Y_POS"), -1);
	int x2 = config->Read(section + wxT("MAIN_X_SIZE"), -1);
	int y2 = config->Read(section + wxT("MAIN_Y_SIZE"), -1);

	int maximized = config->Read(section + wxT("Maximized"), 01);

	// Kry - Random usable pos for m_srv_split_pos
	m_srv_split_pos = config->Read(section + wxT("SRV_SPLITTER_POS"), 463l);
	if (!override_size) {
		if (x2 > 0 && y2 > 0) {
			SetSize(x2, y2);
		} else {
#ifndef __WXGTK__
			// Probably first run.
			Maximize();
#endif
		}
	}

	if (!override_pos) {
		// If x1 and y1 != -1 Redefine location
		if(x1 != -1 && y1 != -1) {
			wxRect display = wxGetClientDisplayRect();
			if (x1 <= display.GetRightTop().x && y1 <= display.GetRightBottom().y) {
				Move(x1, y1);
			} else {
				// It's offscreen... so let's not.
			}
		}
	}

	if (!override_size && !override_pos && maximized) {
		Maximize();
	}

	return true;
}
Esempio n. 3
0
FB_Frame::FB_Frame( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) :
    wxFrame( parent, id, caption, pos, size, style ) {
    wxSystemOptions::SetOption(wxT("msw.notebook.themed-background"), 0);
    m_Config = new FB_Config(  );
    m_DocList = new FB_DocList;
    m_StatusBar = new FB_StatusBar( this );
    m_ToolBar = new FB_ToolBar( this );
        
    if ( m_Config->winw==-1||m_Config->winh==-1 ) {
        SetSize(300, 200);
        Centre();
        Maximize();
    }
    else {
        Move(m_Config->winx, m_Config->winy);
        SetSize(m_Config->winw, m_Config->winh);
    }
    Show( true );
        
    m_Code_area = NULL;
    m_ActiveTabID = -1;
    
    Freeze();
        CreateMenus();
        CreateToolbar();
        CreatePanels();
        CreateStatusBar();
    Thaw();

    SendSizeEvent();
    SetStatus();
    m_Config->m_FileHistory->AddFilesToMenu();
}
Esempio n. 4
0
void wxTopLevelWindowDFB::Restore()
{
    if ( IsMaximized() )
    {
        Maximize(false);
    }
}
Esempio n. 5
0
void wxTopLevelWindowMac::Restore()
{
    if ( IsMaximized() )
        Maximize(false);
    else if ( IsIconized() )
        Iconize(false);
}
Esempio n. 6
0
//---------------------------------------------------------
CSGDI_Dialog::CSGDI_Dialog(const wxString &Name, int Style)
	: wxDialog((wxWindow *)SG_UI_Get_Window_Main(), wxID_ANY, Name, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
	wxRect	r(0, 0, wxSystemSettings::GetMetric(wxSYS_SCREEN_X), wxSystemSettings::GetMetric(wxSYS_SCREEN_Y));
	r.Deflate((int)(0.1 * r.GetWidth()), (int)(0.1 * r.GetHeight()));
	SetSize(r);

	if( Style & SGDI_DLG_STYLE_START_MAXIMISED )
	{
		Maximize();
	}

	m_Ctrl_Color	= *wxBLACK;

	m_pSizer_Ctrl	= new wxStaticBoxSizer(wxVERTICAL, this, wxT(""));
	m_pSizer_Output	= new wxStaticBoxSizer(wxVERTICAL, this, wxT(""));

	wxSizer	*pSizer	= new wxBoxSizer(wxHORIZONTAL);

	if( Style & SGDI_DLG_STYLE_CTRLS_RIGHT )
	{
		pSizer->Add(m_pSizer_Output	, 1, wxALIGN_RIGHT|wxALL|wxEXPAND, SGDI_CTRL_SPACE);
		pSizer->Add(m_pSizer_Ctrl	, 0, wxALIGN_LEFT |wxALL|wxEXPAND, SGDI_CTRL_SPACE);
	}
	else
	{
		pSizer->Add(m_pSizer_Ctrl	, 0, wxALIGN_LEFT |wxALL|wxEXPAND, SGDI_CTRL_SPACE);
		pSizer->Add(m_pSizer_Output	, 1, wxALIGN_RIGHT|wxALL|wxEXPAND, SGDI_CTRL_SPACE);
	}

	pSizer->FitInside(this);

	SetSizer(pSizer);
}
Esempio n. 7
0
void MainFrame::RestorePosition(const wxString &name)
{
	bool maximized;
	int x, y, w, h;

	m_currentDir = wxT("./projects");

	wxConfigBase *config = wxConfigBase::Get();
	config->SetPath(name);
	if (config->Read(wxT("IsMaximized"), &maximized))
	{
		Maximize(maximized);
		x = y = w = h = -1;
		config->Read(wxT("PosX"), &x);
		config->Read(wxT("PosY"), &y);
		config->Read(wxT("SizeW"), &w);
		config->Read(wxT("SizeH"), &h);
		SetSize(x, y, w, h);
		bool iconized = false;
		config->Read(wxT("IsIconized"), &iconized);
		if (iconized) Iconize(iconized);
	}
	config->Read(wxT("CurrentDirectory"), &m_currentDir);

	config->Read(wxT("RecentFile0"),&m_recentProjects[0]);
	config->Read(wxT("RecentFile1"),&m_recentProjects[1]);
	config->Read(wxT("RecentFile2"),&m_recentProjects[2]);
	config->Read(wxT("RecentFile3"),&m_recentProjects[3]);

	config->SetPath(wxT(".."));
	UpdateRecentProjects();
}
Esempio n. 8
0
void
Shader::LoadConfig()
{
	wxConfigBase *config = wxConfigBase::Get();
	//config->DeleteAll();
	// Load the window position on the screen.
	wxRect pos = GetScreenRect();
	long value;
	bool ok = config->Read(wxT("main_x"), &value);
	pos.SetX(value);
	ok = ok && config->Read(wxT("main_y"), &value);
	pos.SetY(value);
	ok = ok && config->Read(wxT("main_width"), &value);
	pos.SetWidth(value);
	ok = ok && config->Read(wxT("main_height"), &value);
	pos.SetHeight(value);
	if (ok)
	{
		SetSize(pos);
	}
	// Check if the window was maximized.
	if (config->Read(wxT("main_maximized"), &value) && value != 0)
	{
		Maximize();
	}
	// Load the list of recent projects.
	m_RecentMenu->Load(*config, wxT("main_recent"));
}
Esempio n. 9
0
CMainFrame::CMainFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxDefaultSize)
{
	//wxDisplay Screen;
	//wxRect ClientRect = Screen.GetClientArea();

	//this->SetSize(ClientRect);
	Maximize(true);
	m_panel = new wxPanel(this);
	initPanel();

	wxMenu *fileMenu = new wxMenu();
	wxMenu *helpMenu = new wxMenu();

	helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"),
		wxT("Show about dialog"));
	fileMenu->Append(wxID_OPEN, wxT("&Open..."), wxT("Open Spell File"));
	fileMenu->Append(wxID_EXIT, wxT("&Quit...\tF2"),
		wxT("Quit App"));
	wxMenuBar *menuBar = new wxMenuBar();
	menuBar->Append(fileMenu, wxT("&File"));
	menuBar->Append(helpMenu, wxT("&Help"));
	SetMenuBar(menuBar);

	CreateStatusBar(2);
	SetStatusText(wxT("Welcome to use spelleditor!"));
}
Esempio n. 10
0
void
wxMFrame::Create(const String &framename, wxWindow *parent)
{
   wxCHECK_RET( !m_initialised, _T("wxMFrame created twice") );

   SetName(framename);

   int xpos, ypos, width, height;
   bool startIconised, startMaximised;
   RestorePosition(MFrameBase::GetName(), &xpos, &ypos, &width, &height,
                   &startIconised, &startMaximised);

   // use name as default title
   if ( !wxFrame::Create(parent, -1, framename,
                         wxPoint(xpos, ypos), wxSize(width,height)) )
   {
      wxFAIL_MSG( _T("Failed to create a frame!") );

      return;
   }

   SetIcon(ICON(_T("MFrame")));

   // no "else": a frame can be maximized and iconized, meaning that it will
   // become maximized when restored
   if ( startMaximised )
      Maximize();
   if ( startIconised )
      Iconize();

   m_initialised = true;
   SetMenuBar(new wxMenuBar(wxMB_DOCKABLE));
}
Esempio n. 11
0
//************************************************************************
// Called when an LCD-button is pressed
//************************************************************************
void CChatScreen::OnLCDButtonDown(int iButton)
{
	switch(m_eReplyState)
	{
	case REPLY_STATE_NONE:
		if(iButton == LGLCDBUTTON_CANCEL) {
			CAppletManager::GetInstance()->ActivatePreviousScreen();
		} else if(iButton == LGLCDBUTTON_BUTTON2 || iButton == LGLCDBUTTON_MENU)
			CAppletManager::GetInstance()->ActivateEventScreen();
		// enter reply mode
		else if(iButton == LGLCDBUTTON_BUTTON3 || iButton == LGLCDBUTTON_OK)
			ActivateMessageMode();
		else {
			bool bRes = false;
			if(iButton == LGLCDBUTTON_BUTTON0 || iButton == LGLCDBUTTON_UP) {
				bRes = m_TextLog.ScrollUp();
			} else if(iButton == LGLCDBUTTON_BUTTON1 || iButton == LGLCDBUTTON_DOWN) {
				bRes = m_TextLog.ScrollDown();
			}

			if(bRes && CConfig::GetBoolSetting(SESSION_SCROLL_MAXIMIZED)) {
				Maximize(5000);
			}
		}
		break;
	case REPLY_STATE_FAILED:
		if(iButton == LGLCDBUTTON_BUTTON2 || iButton == LGLCDBUTTON_CANCEL) {
			DeactivateMessageMode();
		} else if(iButton == LGLCDBUTTON_BUTTON3 || iButton == LGLCDBUTTON_OK) {
			ActivateMessageMode();
		}
/*
		// Dead code
		 else if(iButton == LGLCDBUTTON_CANCEL) {
			DeactivateMessageMode();
			CAppletManager::GetInstance()->ActivatePreviousScreen();
		}
*/
		else if(iButton == LGLCDBUTTON_MENU) {
			DeactivateMessageMode();
			CAppletManager::GetInstance()->ActivateEventScreen();
		}
		break;
	case REPLY_STATE_SENDING:
		break;
	case REPLY_STATE_INPUT:
		if(iButton == LGLCDBUTTON_BUTTON0 || iButton == LGLCDBUTTON_UP) {
			m_Input.ScrollLine(0);
		} else if(iButton == LGLCDBUTTON_BUTTON1 || iButton == LGLCDBUTTON_DOWN) {
			m_Input.ScrollLine(1);
		// send the message
		} else if(iButton == LGLCDBUTTON_BUTTON3 || iButton == LGLCDBUTTON_OK) {
			SendCurrentMessage();
		// cancel message mode
		} else if(iButton == LGLCDBUTTON_BUTTON2 || iButton == LGLCDBUTTON_CANCEL) {
			DeactivateMessageMode();
		}
		break;
	}
}
void CXTPDockingPaneTabbedContainer::OnCaptionButtonClick(CXTPDockingPaneCaptionButton* pButton)
{
	CXTPDockingPane* pSelectedPane = m_pSelectedPane;

	CXTPDockingPaneManager* pManager = GetDockingPaneManager();

	switch (pButton->GetID())
	{
	case XTP_IDS_DOCKINGPANE_CLOSE:

		if (pManager->m_bCloseGroupOnButtonClick)
		{
			POSITION pos = m_lstPanes.GetTailPosition();
			while (pos)
			{
				CXTPDockingPane* pPane = (CXTPDockingPane*)m_lstPanes.GetPrev(pos);

				ClosePane(pPane);
			}

		}
		else if (pSelectedPane)
		{
			ClosePane(pSelectedPane);
		}
		break;


	case XTP_IDS_DOCKINGPANE_AUTOHIDE:

		if (!IsHidden())
		{
			if (!pManager->NotifyAction(xtpPaneActionUnpinning, pSelectedPane))
			{
				GetDockingSite()->SetFocus();
				NormalizeDockingSize();
				pSelectedPane->Hide();
				pManager->NotifyAction(xtpPaneActionUnpinned, pSelectedPane);
			}

		}
		else
		{
			GetDockingPaneManager()->ToggleDocking(pManager->m_bHideGroupOnButtonClick ?
				(CXTPDockingPaneBase*)this : (CXTPDockingPaneBase*)pSelectedPane);
		}

		break;

	case XTP_IDS_DOCKINGPANE_MAXIMIZE:
		Maximize();
		break;

	case XTP_IDS_DOCKINGPANE_RESTORE:
		Restore();
		break;

	}
}
Esempio n. 13
0
/* MainWindow::MainWindow
 * MainWindow class constructor
 *******************************************************************/
MainWindow::MainWindow()
: STopWindow("SLADE", mw_left, mw_top, mw_width, mw_height) {
	lasttipindex = 0;
	custom_menus_begin = 2;
	if (mw_maximized) Maximize();
	setupLayout();
	SetDropTarget(new MainWindowDropTarget());
}
Esempio n. 14
0
void EDA_BASE_FRAME::LoadSettings( wxConfigBase* aCfg )
{
    int maximized = 0;

    wxString baseCfgName = ConfigBaseName();

    wxString text = baseCfgName + entryPosX;
    aCfg->Read( text, &m_FramePos.x );

    text = baseCfgName + entryPosY;
    aCfg->Read( text, &m_FramePos.y );

    text = baseCfgName + entrySizeX;
    aCfg->Read( text, &m_FrameSize.x, 600 );

    text = baseCfgName + entrySizeY;
    aCfg->Read( text, &m_FrameSize.y, 400 );

    text = baseCfgName + entryMaximized;
    aCfg->Read( text, &maximized, 0 );

    if( m_hasAutoSave )
    {
        text = baseCfgName + entryAutoSaveInterval;
        aCfg->Read( text, &m_autoSaveInterval, DEFAULT_AUTO_SAVE_INTERVAL );
    }

    // Ensure the window is on a connected display, and is visible.
    // (at least a corner of the frame must be visible on screen)
    // Sometimes, if a window was moved on an auxiliary display, and when this
    // display is no more available, it is not the case.
    wxRect rect( m_FramePos, m_FrameSize );

    if( wxDisplay::GetFromPoint( rect.GetTopLeft() ) == wxNOT_FOUND &&
        wxDisplay::GetFromPoint( rect.GetTopRight() ) == wxNOT_FOUND &&
        wxDisplay::GetFromPoint( rect.GetBottomLeft() ) == wxNOT_FOUND &&
        wxDisplay::GetFromPoint( rect.GetBottomRight() ) == wxNOT_FOUND )
    {
        m_FramePos = wxDefaultPosition;
    }

    // Ensure Window title bar is visible
#if defined( __WXMAC__ )
    // for macOSX, the window must be below system (macOSX) toolbar
    // Ypos_min = GetMBarHeight(); seems no more exist in new API (subject to change)
    int Ypos_min = 20;
#else
    int Ypos_min = 0;
#endif
    if( m_FramePos.y < Ypos_min )
        m_FramePos.y = Ypos_min;

    if( maximized )
        Maximize();

    aCfg->Read( baseCfgName + entryPerspective, &m_perspective );
    aCfg->Read( baseCfgName + entryMruPath, &m_mruPath );
}
Esempio n. 15
0
void CDlgMessages::RestoreWindowDimensions() {
    wxString        strBaseConfigLocation = wxString(wxT("/Simple/Messages"));
    wxConfigBase*   pConfig = wxConfigBase::Get(FALSE);
    bool            bWindowIconized = false;
    bool            bWindowMaximized = false;
    int             iHeight = 0;
    int             iWidth = 0;
    int             iTop = 0;
    int             iLeft = 0;

    wxASSERT(pConfig);

    pConfig->SetPath(strBaseConfigLocation);

    pConfig->Read(wxT("YPos"), &iTop, 30);
    pConfig->Read(wxT("XPos"), &iLeft, 30);
    pConfig->Read(wxT("Width"), &iWidth, 640);
    pConfig->Read(wxT("Height"), &iHeight, 480);
    pConfig->Read(wxT("WindowIconized"), &bWindowIconized, false);
    pConfig->Read(wxT("WindowMaximized"), &bWindowMaximized, false);

    // Guard against a rare situation where registry values are zero
    if (iWidth < 50) iWidth = 640;
    if (iHeight < 50) iHeight = 480;

#ifndef __WXMAC__

    // If either co-ordinate is less then 0 then set it equal to 0 to ensure
    // it displays on the screen.
    if ( iLeft < 0 ) iLeft = 30;
    if ( iTop < 0 ) iTop = 30;

    // Read the size of the screen
    wxInt32 iMaxWidth = wxSystemSettings::GetMetric( wxSYS_SCREEN_X );
    wxInt32 iMaxHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );

    // Max sure that it doesn't go off to the right or bottom
    if ( iLeft + iWidth > iMaxWidth ) iLeft = iMaxWidth - iWidth;
    if ( iTop + iHeight > iMaxHeight ) iTop = iMaxHeight - iHeight;

    if (!IsIconized() && !IsMaximized()) {
        SetSize(iLeft, iTop, iWidth, iHeight);
    }
    Iconize(bWindowIconized);
    Maximize(bWindowMaximized);

#else   // ! __WXMAC__

    // If the user has changed the arrangement of multiple 
    // displays, make sure the window title bar is still on-screen.
    if (!IsWindowOnScreen(iLeft, iTop, iWidth, iHeight)) {
        iTop = iLeft = 30;
    }
        SetSize(iLeft, iTop, iWidth, iHeight);
#endif  // ! __WXMAC__
}
Esempio n. 16
0
void wxTopLevelWindowMGL::Restore()
{
    if ( IsIconized() )
    {
        Iconize(false);
    }
    if ( IsMaximized() )
    {
        Maximize(false);
    }
}
Esempio n. 17
0
/* MainWindow::MainWindow
 * MainWindow class constructor
 *******************************************************************/
MainWindow::MainWindow()
	: STopWindow("SLADE", "main")
{
	lasttipindex = 0;
	custom_menus_begin = 2;
	if (mw_maximized) Maximize();
	setupLayout();
	SetDropTarget(new MainWindowDropTarget());
#ifdef USE_WEBVIEW_STARTPAGE
	docs_page = NULL;
#endif
}
void CDlgMessages::RestoreWindowDimensions() {
    wxString        strBaseConfigLocation = wxString(wxT("/Simple/Messages"));
    wxConfigBase*   pConfig = wxConfigBase::Get(FALSE);
    bool            bWindowIconized = false;
    bool            bWindowMaximized = false;
    int             iHeight = 0;
    int             iWidth = 0;
    int             iTop = 0;
    int             iLeft = 0;

    wxASSERT(pConfig);

    pConfig->SetPath(strBaseConfigLocation);

    pConfig->Read(wxT("YPos"), &iTop, 30);
    pConfig->Read(wxT("XPos"), &iLeft, 30);
    pConfig->Read(wxT("Width"), &iWidth, 640);
    pConfig->Read(wxT("Height"), &iHeight, 480);
    pConfig->Read(wxT("WindowIconized"), &bWindowIconized, false);
    pConfig->Read(wxT("WindowMaximized"), &bWindowMaximized, false);

#ifndef __WXMAC__

    Iconize(bWindowIconized);
    Maximize(bWindowMaximized);
    if (!IsIconized() && !IsMaximized()) {
        SetSize(-1, -1, iWidth, iHeight);
    }

#else   // ! __WXMAC__

    // If the user has changed the arrangement of multiple 
    // displays, make sure the window title bar is still on-screen.
    Rect titleRect = {iTop, iLeft, iTop+22, iLeft+iWidth };
    InsetRect(&titleRect, 5, 5);    // Make sure at least a 5X5 piece visible
    RgnHandle displayRgn = NewRgn();
    CopyRgn(GetGrayRgn(), displayRgn);  // Region encompassing all displays
    Rect menuRect = ((**GetMainDevice())).gdRect;
    menuRect.bottom = GetMBarHeight() + menuRect.top;
    RgnHandle menuRgn = NewRgn();
    RectRgn(menuRgn, &menuRect);                // Region hidden by menu bar
    DiffRgn(displayRgn, menuRgn, displayRgn);   // Subtract menu bar retion
    if (!RectInRgn(&titleRect, displayRgn))
        iTop = iLeft = 30;
    DisposeRgn(menuRgn);
    DisposeRgn(displayRgn);

    SetSize(iLeft, iTop, iWidth, iHeight);

#endif  // ! __WXMAC__
}
void ModelNodeButton::mousePressEvent ( QGraphicsSceneMouseEvent * event ) {

	if (minimized == false) {
		this->minimized = true;
		img = QImage (":/Icons/ressources/list-add.png");
		emit Minimize();
	} else {
		this->minimized = false;
		img = QImage (":/Icons/ressources/list-remove.png");
		emit Maximize();
	}

	QGraphicsItem::mousePressEvent(event);
}
Esempio n. 20
0
// }}}
// {{{ void MainFrame::LoadSize()
void MainFrame::LoadSize() {
	bool max = false;

	config->Read(wxT("Maximised"), &max);
	if (max) {
		Maximize(true);
	}
	else {
		SetSize(config->Read(wxT("Position/X"), 10L), 
			config->Read(wxT("Position/Y"), 10L),
			config->Read(wxT("Size/Width"), 780L),
			config->Read(wxT("Size/Height"), 550L));
	}
}
Esempio n. 21
0
void ObjectInstance::ComputeBBox() {
	BBox b = tree->GetBBox();
	floatq x0(b.min.x);
	floatq x1(b.max.x);
	floatq y(b.min.y, b.min.y, b.max.y, b.max.y);
	floatq z(b.min.z, b.max.z, b.min.z, b.max.z);
	Vec3q p0(	y * rotation[0].y + z * rotation[0].z,
				y * rotation[1].y + z * rotation[1].z,
				y * rotation[2].y + z * rotation[2].z);
	Vec3q p1(	x1 * rotation[0].x + p0.x,
				x1 * rotation[1].x + p0.y,
				x1 * rotation[2].x + p0.z);
	p0.x += x0 * rotation[0].x;
	p0.y += x0 * rotation[1].x;
	p0.z += x0 * rotation[2].x;
	bbox = BBox(Minimize(VMin(p0, p1)) + translation, Maximize(VMax(p0, p1)) + translation);
}
Esempio n. 22
0
void wxGISApplication::SerializeFramePos(bool bSave)
{
	wxGISAppConfig oConfig = GetConfig();
	if(!oConfig.IsOk())
		return;

	if(bSave)
	{
		if( IsMaximized() )
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/maxi")), true);
		else
		{
			int x, y, w, h;
			GetClientSize(&w, &h);
			GetPosition(&x, &y);
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/maxi")), false);
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/width")), w);
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/height")), h);
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/xpos")), x);
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/ypos")), y);
		}
		//status bar shown state
		oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/statusbar/shown")), IsStatusBarShown());
	}
	else
	{
		//load
		bool bMaxi = oConfig.ReadBool(enumGISHKCU, GetAppName() + wxString(wxT("/frame/maxi")), false);
		if(!bMaxi)
		{
			int x = oConfig.ReadInt(enumGISHKCU, GetAppName() + wxString(wxT("/frame/xpos")), 50);
			int y = oConfig.ReadInt(enumGISHKCU, GetAppName() + wxString(wxT("/frame/ypos")), 50);
			int w = oConfig.ReadInt(enumGISHKCU, GetAppName() + wxString(wxT("/frame/width")), 850);
			int h = oConfig.ReadInt(enumGISHKCU, GetAppName() + wxString(wxT("/frame/height")), 530);
			Move(x, y);
			SetClientSize(w, h);
		}
		else
		{
			Maximize();
		}
		//status bar shown state
		wxGISApplication::ShowStatusBar(oConfig.ReadBool(enumGISHKCU, GetAppName() + wxString(wxT("/frame/statusbar/shown")), true));
	}
}
Esempio n. 23
0
void wxGxObjectDialog::SerializeFramePos(bool bSave)
{
	wxGISAppConfig oConfig = GetConfig();
	if(!oConfig.IsOk())
        return;

	if(bSave)
	{
		if( IsMaximized() )
		{
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/maxi")), true);
		}
		else
		{
			int x, y, w, h;
			GetClientSize(&w, &h);
			GetPosition(&x, &y);

			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/maxi")), false);
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/width")), w);
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/height")), h);
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/xpos")), x);
			oConfig.Write(enumGISHKCU, GetAppName() + wxString(wxT("/frame/ypos")), y);
		}
	}
	else
	{
		//load
		bool bMaxi = oConfig.ReadBool(enumGISHKCU, GetAppName() + wxString(wxT("/frame/maxi")), false);
		if(!bMaxi)
		{
			int x = oConfig.ReadInt(enumGISHKCU, GetAppName() + wxString(wxT("/frame/xpos")), 50);
			int y = oConfig.ReadInt(enumGISHKCU, GetAppName() + wxString(wxT("/frame/ypos")), 50);
			int w = oConfig.ReadInt(enumGISHKCU, GetAppName() + wxString(wxT("/frame/width")), 450);
			int h = oConfig.ReadInt(enumGISHKCU, GetAppName() + wxString(wxT("/frame/height")), 650);

			Move(x, y);
			SetClientSize(w, h);
		}
		else
		{
			Maximize();
		}
	}
}
Esempio n. 24
0
void CSkinWin::OnNcLButtonDblClk(UINT nHitTest, CPoint point)
{
	if(m_pHookedWnd->IsKindOf( RUNTIME_CLASS( CTabDialog )))
	{
		 if(nHitTest == HTCAPTION)
            nHitTest = HTCLIENT;
	}
    if ( nHitTest == HTCAPTION )   //&& m_sizable 
    {
        if ( m_winstate == 1 )
            Restore();
        else
            Maximize(); //ShowWindow(m_hWnd, SW_MAXIMIZE);
        m_downHitTest = 0;
        m_moveHitTest = 0;
        OnNcPaint(0);
    }
}
Esempio n. 25
0
MyFrame::MyFrame(const wxString& title):wxFrame(NULL,wxID_ANY,title,wxDefaultPosition,wxDefaultSize)
{
    Maximize(true);
    int width,height;
    GetClientSize(&width,&height);
    int minWIDTH = width/7;
    int minHEIGHT = height/7;
    int defSashPos1 = width - width/5;
    int defSashPos0 = width/5;
    wxSplitterWindow * mainWindow = new wxSplitterWindow(this,wxID_ANY);
    wxSplitterWindow * subWindowV = new wxSplitterWindow(mainWindow,wxID_ANY);
    wxSplitterWindow * subWindowH = new wxSplitterWindow(mainWindow,wxID_ANY);
    subWindowH->SetSashGravity(0.7);
    subWindowV->SetSashGravity(0);
    subWindowV->SetMinimumPaneSize(minWIDTH);
    mainWindow->SetSashGravity(1);
    mainWindow->SetMinimumPaneSize(minWIDTH);
    subWindowH->SetMinimumPaneSize(minHEIGHT);
    PanelA * panelA = new PanelA(subWindowV);
    panelA->IT();
    PanelB * panelB = new PanelB(subWindowV);
    //panelB->SetMinSize(wxSize(500,NULL));
    panelB->SetUpGUI();

    PanelC * panelC = new PanelC(subWindowH);
    panelC->SetUpGUI();
    PanelD * panelD = new PanelD(subWindowH);
    panelD->SetUpGUI();
    subWindowV->SplitVertically(panelA,panelB);
    subWindowH->SplitHorizontally(panelC,panelD);
    mainWindow->SplitVertically(subWindowV,subWindowH);
    subWindowV->SetSashPosition(defSashPos0);
    mainWindow->SetSashPosition(defSashPos1);
    wxMenu * fMenu = new wxMenu;
    wxMenu * hMenu = new wxMenu;
    hMenu->Append(wxID_ABOUT,wxT("About...\tF2"),wxT("Show about Dialog"));
    fMenu->Append(wxID_EXIT,wxT("Exit\tAlt-X"),wxT("Quit This Program"));
    wxMenuBar * menuBar = new wxMenuBar();
    menuBar->Append(fMenu,wxT("File"));
    menuBar->Append(hMenu,wxT("Help"));
    SetMenuBar(menuBar);
    CreateStatusBar(2);
    SetStatusText("Welcome");
}
void EDA_BASE_FRAME::LoadSettings( wxConfigBase* aCfg )
{
    int maximized = 0;

    wxString baseCfgName = ConfigBaseName();

    wxString text = baseCfgName + wxT( "Pos_x" );
    aCfg->Read( text, &m_FramePos.x );

    text = baseCfgName + wxT( "Pos_y" );
    aCfg->Read( text, &m_FramePos.y );

    text = baseCfgName + wxT( "Size_x" );
    aCfg->Read( text, &m_FrameSize.x, 600 );

    text = baseCfgName + wxT( "Size_y" );
    aCfg->Read( text, &m_FrameSize.y, 400 );

    text = baseCfgName + wxT( "Maximized" );
    aCfg->Read( text, &maximized, 0 );

    if( m_hasAutoSave )
    {
        text = baseCfgName + entryAutoSaveInterval;
        aCfg->Read( text, &m_autoSaveInterval, DEFAULT_AUTO_SAVE_INTERVAL );
    }

    // Ensure Window title bar is visible
#if defined( __WXMAC__ )
    // for macOSX, the window must be below system (macOSX) toolbar
    // Ypos_min = GetMBarHeight(); seems no more exist in new API (subject to change)
    int Ypos_min = 20;
#else
    int Ypos_min = 0;
#endif
    if( m_FramePos.y < Ypos_min )
        m_FramePos.y = Ypos_min;

    if( maximized )
        Maximize();

    aCfg->Read( baseCfgName + entryPerspective, &m_perspective );
}
Esempio n. 27
0
/* MapEditorWindow::MapEditorWindow
 * MapEditorWindow class constructor
 *******************************************************************/
MapEditorWindow::MapEditorWindow()
	: STopWindow("SLADE", "map")
{
	if (mew_maximized) Maximize();
	setupLayout();
	Show(false);
	custom_menus_begin = 2;
	backup_manager = new MapBackupManager();

	// Set icon
	string icon_filename = appPath("slade.ico", DIR_TEMP);
	theArchiveManager->programResourceArchive()->getEntry("slade.ico")->exportFile(icon_filename);
	SetIcon(wxIcon(icon_filename, wxBITMAP_TYPE_ICO));
	wxRemoveFile(icon_filename);

	// Bind events
	Bind(wxEVT_CLOSE_WINDOW, &MapEditorWindow::onClose, this);
	Bind(wxEVT_SIZE, &MapEditorWindow::onSize, this);
}
Esempio n. 28
0
void TopWindow::SerializePlacement(Stream& s, bool reminimize)
{
	GuiLock __;
	int version = 0;
	s / version;
	Rect rect = GetRect();
	s % overlapped % rect;
	bool mn = state == MINIMIZED;
	bool mx = state == MAXIMIZED;
	s.Pack(mn, mx);
	LLOG("TopWindow::SerializePlacement / " << (s.IsStoring() ? "write" : "read"));
	LLOG("minimized = " << mn << ", maximized = " << mx);
	LLOG("rect = " << rect << ", overlapped = " << overlapped);
	if(s.IsLoading()) {
		if(mn) rect = overlapped;
		Rect limit = GetVirtualWorkArea();
		Rect fm = windowFrameMargin;
		if((fm.left|fm.right|fm.top|fm.bottom) == 0)
			fm = Rect(8, 32, 8, 8);
		limit.left += fm.left;
		limit.right -= fm.right;
		limit.top += fm.top;
		limit.bottom -= fm.bottom;
		Size sz = min(rect.Size(), limit.Size());
		rect = RectC(
			minmax(rect.left, limit.left, limit.right - sz.cx),
			minmax(rect.top,  limit.top,  limit.bottom - sz.cy),
			sz.cx, sz.cy);
		state = OVERLAPPED;
		if(mn && reminimize)
			state = MINIMIZED;
		if(mx)
			state = MAXIMIZED;
		if(state == OVERLAPPED)
			SetRect(rect);
		if(IsOpen()) {
			if(state == MINIMIZED)
				Minimize(false);
			if(state == MAXIMIZED)
				Maximize(false);
		}
	}
}
Esempio n. 29
0
void wxGD::MainFrame::LoadLayout()
{
    wxString perspective;
    bool     maximized, iconized;

    wxConfigBase::Get()->Read( "/mainframe/perspective", &perspective );
    wxConfigBase::Get()->Read( "/mainframe/maximized",   &maximized, true );
    wxConfigBase::Get()->Read( "/mainframe/iconized",    &iconized, false );

    if( !perspective.empty() )
    {
        m_mgr->LoadPerspective( perspective );
        m_mgr->Update();
    }

    if( maximized )
    {
        Maximize( maximized );
    }
    else if( iconized )
    {
        Iconize( iconized );
    }
    else
    {
        int x, y, w, h;
        x = y = w = h = -1;

        wxConfigBase::Get()->Read( "/mainframe/left",   &x );
        wxConfigBase::Get()->Read( "/mainframe/top",    &y );
        wxConfigBase::Get()->Read( "/mainframe/width",  &w );
        wxConfigBase::Get()->Read( "/mainframe/height", &h );

        if( x > -1 && y > -1 && w >= 630 && h >= 480 )
        {
            SetSize( x, y, w, h );
        }
    }

    wxConfigBase::Get()->Read( "last_dir", &m_lastDir );
    m_history.Load( *wxConfigBase::Get() );
}
Esempio n. 30
0
Frame::Frame(wxWindow* WXUNUSED(parent), const wxChar *title)
: m_fileMenu(NULL)
, m_editMenu(NULL)
, m_visualMenu(NULL)
, m_menuBar(NULL)
#ifdef DEVELOPMENT
, m_logTargetOld(NULL)
#endif
, book(NULL)
, secondBook(NULL)
, m_bShowImages(false)
, m_bVCStyle(false)
, newPageCounter(0)
{
	m_ImageList.push_back(wxXmlResource::Get()->LoadBitmap(wxT("book_red")));
	m_ImageList.push_back(wxXmlResource::Get()->LoadBitmap(wxT("book_green")));
	m_ImageList.push_back(wxXmlResource::Get()->LoadBitmap(wxT("book_blue")));
	Create(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(800, 600), wxDEFAULT_FRAME_STYLE | wxMAXIMIZE |wxNO_FULL_REPAINT_ON_RESIZE);
	Maximize();
}