Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Introduction to wxWidgets

, 25 Dec 2005 GPL3
A beginner's tutorial on wxWidgets for cross platform GUI development.
/* EyeCareFrame.h
 * 
 * Copyright (C) 3 September, 2005 Priyank Bolia
 * http://www.priyank.in
 * 
 * This code is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA
 */

#pragma once

#include "stdwx.h" 
#include "eyecaretaskbaricon.h"
#include "aboutdialog.h"
#include "configdialog.h"

////Frame Style Start
	#undef MAINFrame_STYLE
	#define MAINFrame_STYLE wxCAPTION | wxSYSTEM_MENU | wxMINIMIZE_BOX | wxCLOSE_BOX | wxSTAY_ON_TOP
////Frame Style End

class CEyeCareFrame : public wxFrame
{

private:
	//Start of Enum
	enum
	{
		//GUI Enum Control ID Start
		ID_WXSTATICBOX = 1001,
		ID_WXBUTTON_HIDE = 1002,
		ID_WXSTATICBITMAP_EYE = 1003,
		ID_CONFIG = 1004,
		ID_EXIT = 1005,
		ID_ABOUT = 1006,
		IDD_EYECARE_ABOUT_DIALOG = 1007,
		IDD_EYECARE_CONFIG_DIALOG = 1008,
		ID_MAINWINDOWTIMER = 1009,
		ID_EYERELAX_TIMER = 1010,
		ID_EYEWASH_TIMER = 1011,
		ID_WXSTATICTEXT_HEADER = 1012,
		ID_WXSTATICTEXT_DETAIL = 1013,
		ID_HIDE = 1014,
		//GUI Enum Control ID End
		ID_DUMMY_VALUE_ //Dont Delete this DummyValue
	}; 
	//End of Enum

	wxButton *m_buttonHIDE;
	wxStaticBox *m_pStaticBox;
	wxStaticBitmap *m_pBitmapEye;
	wxStaticText *m_pHeaderText;
	wxStaticText *m_pDetailText;
	wxMenuBar *menuBar;
	wxMenu *menuSettings;
	wxMenu *menuHelp;
    wxTimer* m_pMainWindowTimer;
    wxTimer* m_pRelaxTimer;
    wxTimer* m_pWashTimer;
	CEyeCareTaskBarIcon *m_pTaskBarIcon;

	unsigned int m_nRelaxTime;
	unsigned int m_nWashTime;
	bool m_bStayOnTop;
	bool m_bHideTrayIcon;

private:
	CEyeCareFrame(void);

public:
	virtual ~CEyeCareFrame(void);

public:
    CEyeCareFrame( wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("Eye Care"),
       const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(275, 250), long style = MAINFrame_STYLE);

	void OnClose(wxCloseEvent& event);
	void ShowAboutDialog(void);
	void ExitApp(void);
	void ShowMainWindow(bool bShow);
	void RelaxTimerSwitch(bool bON);
	bool IsTimersRunning(void);
	void UpdateConfig(void);

private:
    void CreateGUIControls(void);
	void OnHide(void);

	void OnHideButton(wxCommandEvent& WXUNUSED(event));
	void OnConfig(wxCommandEvent& WXUNUSED(event));
	void OnExit(wxCommandEvent& WXUNUSED(event));
	void OnAbout(wxCommandEvent& WXUNUSED(event));
	void OnHideMainWindow(wxTimerEvent& WXUNUSED(event));
	void OnEyeRelaxTimer(wxTimerEvent& WXUNUSED(event));
	void OnEyeWashTimer(wxTimerEvent& WXUNUSED(event));
	void OnEraseBackground(wxEraseEvent& event);
	void OnEsc(wxCommandEvent& WXUNUSED(event));

#ifdef WIN32
    WXLRESULT MSWWindowProc ( WXUINT message, WXWPARAM wParam, WXLPARAM lParam );
#endif

private:
    DECLARE_EVENT_TABLE()
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Priyank Bolia
Software Developer (Senior)
India India
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.141015.1 | Last Updated 25 Dec 2005
Article Copyright 2005 by Priyank Bolia
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid