Jump to content
  • Advertisement
Sign in to follow this  

Unity Which GUI?

This topic is 5064 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am going to work on a map editor and I have to choose a gui to use. Preferably it would be cross-platform and OO but thats not necassary. It must however work with Dev-C++. I tried to use wxWidgets a while ago but I had problems with it and no one could help. Just in case you where wondering the thread is here

Share this post

Link to post
Share on other sites

#ifndef _MAIN_H_
#define _MAIN_H_

#include <wx/wx.h>

class MainApp : public wxApp
virtual bool OnInit(void);

class AppFrame : public wxFrame
AppFrame(const wxString &title, const wxPoint &pos, const wxSize &size);

// event handlers
void OnQuit(wxCommandEvent &event);
void OnAbout(wxCommandEvent &event);
// any class wishing to process wxWindows events must use this macro

// menu items
MainApp_Quit = 1,

* Event tables and other macros for wxWindows
* The event tables connect the wxWindows events with the
* functions (event handlers) which process them. It can
* be also done at run-time, but for the simple menu
* events like this the static method is much simpler.

BEGIN_EVENT_TABLE(AppFrame, wxFrame)
EVT_MENU(MainApp_Quit, AppFrame::OnQuit)
EVT_MENU(MainApp_About, AppFrame::OnAbout)

* Create a new application object: this macro will allow
* wxWindows to create the application object during program
* execution (it's better than using a static object for many
* reasons) and also declares the accessor function wxGetApp()
* which will return the reference of the right type (i.e. MyApp
* and not wxApp)


#endif _MAIN_H__

* Implementation

#include <wx/wx.h>
#include "main.h"

// program execution "starts" here
AppFrame *frame;

frame = new AppFrame("Application",
wxPoint(50, 50), wxSize(450, 340));

/* 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.

return TRUE;

// frame constructor
AppFrame::AppFrame(const wxString &title, const wxPoint &pos,
const wxSize& size)
: wxFrame ((wxFrame *) NULL, -1, title, pos, size)
wxMenuBar *menuBar;
wxMenu *fileMenu;
wxMenu *helpMenu;

/* "A" is the name of the application's main icon,
* as set by Dev-C++


// create menus
fileMenu = new wxMenu("", wxMENU_TEAROFF);
fileMenu->Append(MainApp_Quit, "E&xit\tCtrl-Q", "Quit this program");
helpMenu = new wxMenu;
helpMenu->Append(MainApp_About, "&About...\tCtrl-A", "Show about dialog");

menuBar = new wxMenuBar();
menuBar->Append(fileMenu, "&File");
menuBar->Append(helpMenu, "&Help");


// create a statusbar

* event handlers

AppFrame::OnQuit(wxCommandEvent &WXUNUSED(event))
// TRUE is to force the frame to close

AppFrame::OnAbout(wxCommandEvent &WXUNUSED(event))
wxString msg;

msg.Printf("Application version 0.1");
wxMessageBox(msg, "About", wxOK | wxICON_INFORMATION, this);

Well there we go.Hope it helps you help me.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!