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 next 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
Re: MainMenu problem [message #35134 is a reply to message #35133] Mon, 16 January 2012 15:52 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Matteo

The first thing is that I cannot see a:

AddFrame(menu);


If menu is no attached to TopWindow prova2 it cannot be visible Smile.


Best regards
Iñaki
Re: MainMenu problem [message #35135 is a reply to message #35133] Mon, 16 January 2012 16:15 Go to previous messageGo to next message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
Koldo Rocks!
thx man... working now

I will start improving my Toolbar and Status now Very Happy

[Updated on: Mon, 16 January 2012 16:15]

Report message to a moderator

Re: MainMenu problem [message #35136 is a reply to message #35135] Mon, 16 January 2012 16:38 Go to previous message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Smile

Best regards
Iñaki
Previous Topic: First time with upp
Next Topic: Invalid build method
Goto Forum:
  


Current Time: Sat Apr 20 00:00:36 CEST 2024

Total time taken to generate the page: 0.04233 seconds