|
|
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » public Ctrl in my class - param in constructor problem
|
Re: public Ctrl in my class - param in constructor problem [message #29951 is a reply to message #29948] |
Wed, 01 December 2010 12:33 |
|
Hi,
You have a slight problem in your C++ syntax. It should be constructor():var(init_value),another_var(init){ constructor body; }. That is in your case:
class SYSTEM_LAY : public WithsystemLayout<TopWindow> {
public:
ChartBOA chartsystem;
typedef SYSTEM_LAY CLASSNAME;
SYSTEM_LAY():chartsystem(7){
Add(chartsystem.LeftPos(0, 800).TopPos(0, 550));
}
Also, in the last code snippet, the constructor definition misses the function body (maybe you just forgot to copy it, but I mention it to be sure ), there must be one even if it is empty:ChartBOA::ChartBOA(int maxserii) : MaxSerii(maxserii){}
Otherwise it seems OK.
Best regards,
Honza
|
|
|
|
|
Re: public Ctrl in my class - param in constructor problem [message #30295 is a reply to message #29948] |
Wed, 22 December 2010 12:39 |
arkady_c
Messages: 14 Registered: December 2010 Location: Polska
|
Promising Member |
|
|
Howk ALL!
I was not,I absorb Scatter
I added a few lines and it is OK(Format time HH:MM:SS // MM:SS)
and void FitToData(bool Y = false,bool X = true);
I have another problem with the index in the constructor.
It compiles but will not fire.
class OptionOB : public Option
{
private:
zmienna * zm;
public:
virtual void PerformAction();
//OptionOB&
void SetAddr(zmienna * azm);
OptionOB& Set(int b);
OptionOB();
virtual ~OptionOB();
};
//-----------------
class OptionFDay : public CtrlFrame
{
private:
zmienna * zm;
public:
virtual void FrameLayout(Rect& r);
virtual void FrameAddSize(Size& sz);
virtual void FrameAdd(Ctrl& parent);
// void SetSetZ();
OptionOB ob[24];
OptionFDay(zmienna& azm)
{
zm = &azm;
for(int i=0;i<24;i++){
ob[i].SetAddr(zm);
//ob[i].SetData(*zm->vari);//this is problem?
}
}
};
//------------
class FrameOb : public ParentCtrl
{
public:
OptionFDay ni,po;
typedef FrameOb CLASSNAME;
FrameOb(zmienna& ani, zmienna& apo) : ni(ani), po(apo)
{
AddFrame(ni); AddFrame(po);
}
};
I tried to load the class OptionFDay (Option:: Set (Option:: setDate)) parameter ratio, also tried in the body OptionOB: Set
I suspect not initialized pointer? (did not have time for unknown reasons to me)
ob: Set (1) - Works
void OptionOB::SetAddr(zmienna * azm)
{
zm = azm;
option = *zm->vari;//
//Set(zm->vi);
}
class zmienna{
private:
int adres;
int vi;
public:
void init_i(int aadres, int avar);
int * vari;
zmienna();
~zmienna(){;}
};
zmienna::zmienna(){
adres = 0;
vi = 0;
vari = &vi;
}
//-------------------------------
void zmienna::init_i(int aadres, int avar){
adres = aadres;
vi = avar;
}
Best regards,
Arkady
-
Attachment: wykres1.jpg
(Size: 67.20KB, Downloaded 476 times)
2a7aff6be3f76940495be32258777636
[Updated on: Thu, 23 December 2010 14:28] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Fri May 03 03:17:49 CEST 2024
Total time taken to generate the page: 0.90257 seconds
|
|
|