m[cun] escribió:
pues sin ver el código .....
hace tiempo podíamos contestar es tipo de preguntas pero se nos rompió la bola de cristal y Ayax se niega a comprar-nos un nueva ... así están las cosas XDD
por eso que no sea:
es un programa en codeblocks con widgets por lo tanto me crea automaticamente los cuatro ficheros, dos de codigo y dos de cabeceras. Es la aplicacion que crea por defecto y que crea una ventana con un menú y una opción de salir.
posicion_ratonapp.cpp
Código:
* Name: posicion_raton_framesApp.cpp
* Purpose: Code for Application Class
* Author: yomismo ()
* Created: 2011-03-31
* Copyright: yomismo ()
* License:
**************************************************************/
#ifdef WX_PRECOMP
#include "wx_pch.h"
#endif
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#include "posicion_raton_framesApp.h"
#include "posicion_raton_framesMain.h"
IMPLEMENT_APP(posicion_raton_framesApp);
bool posicion_raton_framesApp::OnInit()
{
posicion_raton_framesFrame* frame = new posicion_raton_framesFrame(0L, _("wxWidgets Application Template"));
frame->Show();
return true;
}
posicion_ratonmain.cpp
Código:
/***************************************************************
* Name: posicion_raton_framesMain.cpp
* Purpose: Code for Application Frame
* Author: yomismo ()
* Created: 2011-03-31
* Copyright: yomismo ()
* License:
**************************************************************/
#ifdef WX_PRECOMP
#include "wx_pch.h"
#endif
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#include "posicion_raton_framesMain.h"
//helper functions
enum wxbuildinfoformat {
short_f, long_f };
wxString wxbuildinfo(wxbuildinfoformat format)
{
wxString wxbuild(wxVERSION_STRING);
if (format == long_f )
{
#if defined(__WXMSW__)
wxbuild << _T("-Windows");
#elif defined(__WXMAC__)
wxbuild << _T("-Mac");
#elif defined(__UNIX__)
wxbuild << _T("-Linux");
#endif
#if wxUSE_UNICODE
wxbuild << _T("-Unicode build");
#else
wxbuild << _T("-ANSI build");
#endif // wxUSE_UNICODE
}
return wxbuild;
}
BEGIN_EVENT_TABLE(posicion_raton_framesFrame, wxFrame)
EVT_CLOSE(posicion_raton_framesFrame::OnClose)
EVT_MENU(idMenuQuit, posicion_raton_framesFrame::OnQuit)
EVT_MENU(idMenuAbout, posicion_raton_framesFrame::OnAbout)
END_EVENT_TABLE()
posicion_raton_framesFrame::posicion_raton_framesFrame(wxFrame *frame, const wxString& title)
: wxFrame(frame, -1, title)
{
#if wxUSE_MENUS
// create a menu bar
wxMenuBar* mbar = new wxMenuBar();
wxMenu* fileMenu = new wxMenu(_T(""));
fileMenu->Append(idMenuQuit, _("&Quit\tAlt-F4"), _("Quit the application"));
mbar->Append(fileMenu, _("&File"));
wxMenu* helpMenu = new wxMenu(_T(""));
helpMenu->Append(idMenuAbout, _("&About\tF1"), _("Show info about this application"));
mbar->Append(helpMenu, _("&Help"));
SetMenuBar(mbar);
#endif // wxUSE_MENUS
#if wxUSE_STATUSBAR
// create a status bar with some information about the used wxWidgets version
CreateStatusBar(2);
SetStatusText(_("Hello Code::Blocks user!"),0);
SetStatusText(wxbuildinfo(short_f), 1);
#endif // wxUSE_STATUSBAR
}
posicion_raton_framesFrame::~posicion_raton_framesFrame()
{
}
void posicion_raton_framesFrame::OnClose(wxCloseEvent &event)
{
Destroy();
}
void posicion_raton_framesFrame::OnQuit(wxCommandEvent &event)
{
Destroy();
}
void posicion_raton_framesFrame::OnAbout(wxCommandEvent &event)
{
wxString msg = wxbuildinfo(long_f);
wxMessageBox(msg, _("Welcome to..."));
}
posicion_ratonapp.h, el error me lo dá en este cuando compilo me pone que no encuentra el fichero wx/moustate.h
Código:
/***************************************************************
* Name: posicion_raton_framesApp.h
* Purpose: Defines Application Class
* Author: yomismo ()
* Created: 2011-03-31
* Copyright: yomismo ()
* License:
**************************************************************/
#ifndef POSICION_RATON_FRAMESAPP_H
#define POSICION_RATON_FRAMESAPP_H
#include <wx/app.h>
#include <wx/mousestate.h>
#include "wx/cursor.h"
class posicion_raton_framesApp : public wxApp
{
public:
virtual bool OnInit();
};
#endif // POSICION_RATON_FRAMESAPP_H
posicion_ratonmain.h
Código:
/***************************************************************
* Name: posicion_raton_framesMain.h
* Purpose: Defines Application Frame
* Author: yomismo ()
* Created: 2011-03-31
* Copyright: yomismo ()
* License:
**************************************************************/
#ifndef POSICION_RATON_FRAMESMAIN_H
#define POSICION_RATON_FRAMESMAIN_H
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "posicion_raton_framesApp.h"
class posicion_raton_framesFrame: public wxFrame
{
public:
posicion_raton_framesFrame(wxFrame *frame, const wxString& title);
~posicion_raton_framesFrame();
private:
enum
{
idMenuQuit = 1000,
idMenuAbout
};
void OnClose(wxCloseEvent& event);
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
#endif // POSICION_RATON_FRAMESMAIN_H
un saludo.