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 » Pointer on Labels defined in lay.h
Re: Pointer on Labels defined in lay.h [message #42129 is a reply to message #42127] Sat, 22 February 2014 20:33 Go to previous messageGo to previous message
Yeti86 is currently offline  Yeti86
Messages: 10
Registered: February 2014
Promising Member
Hello Oblivion!

Thanks for the reply, but that's not the problem.

Attached you find my layout file. So I have a lot of Buttons and labels which should do all the same, for one instance of my playerclass. For less coding effort I tried to define pointer arrays on the different labels and buttons.

#include "Scoutfunctions.hpp"
using namespace Upp;

#define LAYOUTFILE <blala/blala.lay>
#include <CtrlCore/lay.h>
class blala : public WithblalaLayout<TopWindow> {
public:
	typedef blala CLASSNAME;
	blala();
	~blala();
	//	Label *p_playernames;
	//Label *p_playernumbers;
	Button *p_2points;
	Button *p_3points;
	Button *p_zero_of_one;
	Button *p_one_of_one;
	Label *p_score_value;
	Label *p_freethrows_value;
	Label *p_threesmade;
	playerspace::player* p_Player;
	void set_attributes();
	void push_botton();
};


blala::blala()
{
	p_playernames=new Label[12];
	p_playernumbers=new Label[12];
	p_2points=new Button[12];
	p_3points=new Button[12];
	p_zero_of_one=new Button[12];
	p_one_of_one=new Button[12];
	p_score_value=new Label[12];
	p_freethrows_value=new Label[12];
	p_threesmade=new Label[12];
	p_Player=new playerspace::player[12];
	p_playernames[0]=Player1;
	p_playernames[1]=Player2;
	p_playernames[2]=Player3;
	p_playernames[3]=Player4;
	p_playernames[4]=Player5;
	p_playernames[5]=Player6;
	p_playernames[6]=Player7;
	p_playernames[7]=Player8;
	p_playernames[8]=Player9;
	p_playernames[9]=Player10;
	p_playernames[10]=Player11;
	p_playernames[11]=Player12;


Or is there even a smarter solution, like create a new own class with one row of necessaty buttons and labels?
And than define the diffferent columns with this new class? Would it be possible?

I hope the problem is now explained

Regards
  • Attachment: GUIlayout.png
    (Size: 39.64KB, Downloaded 213 times)

[Updated on: Sat, 22 February 2014 20:34]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dynamic Libraries __declspec(dllexport)
Next Topic: Problem when growing a vector
Goto Forum:
  


Current Time: Mon May 13 00:07:43 CEST 2024

Total time taken to generate the page: 0.02463 seconds