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 » Refreshing Docked Widget/Window/Ctrl
Refreshing Docked Widget/Window/Ctrl [message #38325] Mon, 10 December 2012 07:11
nejnadusho is currently offline  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. Very Happy Very Happy Very Happy Very Happy Very Happy

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 Laughing 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
Previous Topic: Parameter Array reference.
Next Topic: Why isn't the data getting inserted?
Goto Forum:
  


Current Time: Fri Apr 26 18:22:46 CEST 2024

Total time taken to generate the page: 0.02242 seconds