Home » Community » Newbie corner » Refreshing Docked Widget/Window/Ctrl
Refreshing Docked Widget/Window/Ctrl [message #38325] |
Mon, 10 December 2012 07:11 |
nejnadusho
Messages: 60 Registered: October 2012
|
Member |
|
|
Hi,
I have a dockable window with a few docked widgets/Ctrl's in it.
The TopWindow is a class and every widget/Ctrl is separate class from the top one.
TopWindow class
#include "main.h"
#include "T.h"
#include "Me.h"
#include "M.h"
#include "B.h"
namespace SSpace {
class Workspace : public WithMainWorkLayout<DockWindow>{
public:
typedef Workspace CLASSNAME;
Workspace();
private:
virtual void DockInit();
T t;
M m;
Me m;
B b;
};
}
=================================================================
#include "Workspace.h"
namespace SSpace {
Workspace::Workspace(){
CtrlLayout(*this, "hi");
Sizeable().Zoomable();
LockLayout();
}
void Workspace::DockInit(){
DockLeft(Dockable(t.tArray, "T").SizeHint(Size(600, 200)));
DockTop(Dockable(m.mArray, "M"). SizeHint(Size(100, 200)));
DockTop(Dockable(me.meArray, "Me").SizeHint(Size(420, 200)));
DockRight(Dockable(b.bArray, "B").SizeHint(Size(300, 200)));
}
}
And in one of the other classes, the 'T' class, I fetching data for a third one, the 'B' class, and I want to refresh that third 'B' class form the 'T' class on the Docked Window.
The Other 'T' Class
#include "main.h"
#include "SockCon.h"
#include "B.h"
namespace SSpace {
class T{
public:
typedef T CLASSNAME;
T();
void WidgetFactory( One<Ctrl>& x);
void Open(int t);
void ButtonGenerator(int Count);
ArrayCtrl tArray;
int GetCount;
private:
B b;
SockCon sockCon;
int counter;
};
}
==========================================================================
#include "T.h"
namespace SSpace{
T::T(){
counter = 0;
GetCount = 0;
sockCon.Request("T", "I", GetCount);
tArray.AddColumn().Ctrls(THISBACK(WidgetFactory));
ButtonGenerator(GetCount);
tArray.SetLineCy(50);
}
void T::ButtonGenerator(int Count){
for (int i = 1; i <= Count; ++i){
tArray.Add();
}
}
void T::Open(int Number)
{
sockCon.Request( b.iP);
b.DisplayB();////////////////////////////////////////////HERE
}
void T::WidgetFactory(One<Ctrl>& x)
{
Button& b = x.Create<Button>();
b.SetLabel("Ta " + AsString(++counter));
b.SizePos();
b <<= THISBACK1(Open, counter);
}
}
At the HERE place in the 'T' class I was hoping to refresh the 'B' class, by just calling the 'B's constructor inside its own Display function, and that according to my calculations should have affect the widget/Ctrl docked in the 'Workspace' class.
The Display Function in the 'B' class
void B::DisplayB(){
//blablabla//Update the data in the Ctrl
B();// Call the 'B's constructor
}
How can I refresh that 'B' Ctrl on the 'Workspace?'
Thank you very much for your help.
Best,
Georgi
|
|
|
Goto Forum:
Current Time: Tue Apr 29 12:57:13 CEST 2025
Total time taken to generate the page: 0.00441 seconds
|