Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » MainMenu problem
MainMenu problem [message #35133] Mon, 16 January 2012 15:46 Go to previous message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
Hy guys,
I have a problem adding mainmenu to my little program.
Atm i dont receive any error compiling it but i cant see it

this is my code

main.cpp
#include "prova2.h"

prova2::prova2()
{
	CtrlLayout(*this, "Programma di prova");
	Sizeable().Zoomable();
	menu.Set(THISBACK(MainMenu));
	CtrlLayout(modify);							//Layout tab
	CtrlLayout(search);							
	CtrlLayout(volume);							
	tab.Add(modify, "Tab1");					//aggingi tab con nome
	tab.Add(search, "Tab2");					
	tab.Add(volume, "Tab3");

    		
	// you must add a callback on x or y fields update	
	x <<= THISBACK( calcolo) ;
	y <<= THISBACK( calcolo) ;
	
}

void prova2::FileMenu(Bar& bar)
{
    bar.Add("Quit", THISBACK(Quit));
}

void prova2::MainMenu(Bar& bar)
{
    bar.Add("File", THISBACK(FileMenu));
}

void prova2::Quit()
{
 	Break();
}

....	

GUI_APP_MAIN
{
	prova2().Run();
}



prova.h
#ifndef _prova2_prova2_h
#define _prova2_prova2_h

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define LAYOUTFILE <prova2/prova2.lay>
#include <CtrlCore/lay.h>

class prova2 : public Withprova2Layout<TopWindow> {
	WithModifyLayout<ParentCtrl> modify;
	WithSearchLayout<ParentCtrl> search;
	WithVolumeLayout<ParentCtrl> volume;
	MenuBar menu;
	
	void Quit();
    void FileMenu(Bar& bar);
    void MainMenu(Bar& bar);
    
    typedef prova2 CLASSNAME;
					
public:

	prova2();
	
private:
	void calcolo();	
};

#endif


Where is my fail ?!
Regards,
Matteo
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: First time with upp
Next Topic: Invalid build method
Goto Forum:
  


Current Time: Sat Jul 05 07:38:10 CEST 2025

Total time taken to generate the page: 0.03385 seconds