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 » How to add controls from bazaar in my apps ?
How to add controls from bazaar in my apps ? [message #31165] Fri, 11 February 2011 11:30 Go to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

I'm re-discovering U++ after several years without using it, and I'm lost with simple things Embarassed

How can I add in my applications some controls coming from bazaar ? I'm trying to add EditFile, but cannot add the Control4U package...

The only way I found is to make a link (I'm under linux) in the MyApp folder to the bazaar/Control4U folder. It's working, but not elegant...

Is there a better way ?

PS : Why is not the right way to do this described in the Bazaar User Guide ?
Re: How to add controls from bazaar in my apps ? [message #31167 is a reply to message #31165] Fri, 11 February 2011 11:50 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
You probably don't have bazaar nest listed in your assembly.

Use "Set main package" and in the left pane with assemblies edit your current one, or add new one if you are worried about old projects having some conflicts with bazaar packages (unlikely, but not impossible).

In edit append path to bazaar dir to other nest's paths (first input).

Should work then (I'm not aware of other step needed).

PS. will try to improve the guide, you are right, it's missing there, but need some spare time. Smile

[Updated on: Fri, 11 February 2011 11:51]

Report message to a moderator

Re: How to add controls from bazaar in my apps ? [message #31171 is a reply to message #31167] Fri, 11 February 2011 14:37 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Thanks ! I can now add packages from bazaar Smile

But I've still a problem when I compile, as soon as I add EditFile control in the .lay file :

main.cpp
In file included from /home/joseph/upp/uppsrc/CtrlCore/lay.h:22,
                 from /home/joseph/upp/MyApps/testEditFile/testEditFile.h:9,
                 from /home/joseph/upp/MyApps/testEditFile/main.cpp:1:
/home/joseph/upp/MyApps/testEditFile/testEditFile.lay:2: error: ‘EditFile’ does not name a type
In file included from /home/joseph/upp/uppsrc/CtrlCore/lay.h:36,
                 from /home/joseph/upp/MyApps/testEditFile/testEditFile.h:9,
                 from /home/joseph/upp/MyApps/testEditFile/main.cpp:1:
/home/joseph/upp/MyApps/testEditFile/testEditFile.lay: In function ‘void InitLayout(Upp::Ctrl&, L&, D&, testEditFileLayout__layid&) [with L = testEditFile, D
	 = testEditFile]’:
/home/joseph/upp/uppsrc/CtrlCore/TopWindow.h:239:   instantiated from ‘void Upp::CtrlLayout(T&) [with T = testEditFile]’
/home/joseph/upp/uppsrc/CtrlCore/TopWindow.h:247:   instantiated from ‘void Upp::CtrlLayout(T&, const char*) [with T = testEditFile]’
/home/joseph/upp/MyApps/testEditFile/main.cpp:7:   instantiated from here
/home/joseph/upp/MyApps/testEditFile/testEditFile.lay:2: error: ‘class testEditFile’ has no member named ‘edfFile1’
/home/joseph/upp/MyApps/testEditFile/testEditFile.lay:2: error: ‘class testEditFile’ has no member named ‘edfFile1’
/home/joseph/upp/MyApps/testEditFile/testEditFile.lay:2: error: ‘class testEditFile’ has no member named ‘edfFile1’
testEditFile: 1 file(s) built in (0:02.12), 2127 msecs / file, duration = 2132 msecs, parallelization 0%

There were errors. (0:02.28)


Here are my files :
TestEditFile.h
#ifndef _testEditFile_testEditFile_h
#define _testEditFile_testEditFile_h

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define LAYOUTFILE <testEditFile/testEditFile.lay>
#include <CtrlCore/lay.h>



class testEditFile : public WithtestEditFileLayout<TopWindow> {
public:
	typedef testEditFile CLASSNAME;
	testEditFile();
};

#endif

main.cpp
#include "testEditFile.h"



testEditFile::testEditFile()
{
	CtrlLayout(*this, "Window title");
}

GUI_APP_MAIN
{
	testEditFile().Run();
}

testEdifFile.lay
LAYOUT(testEditFileLayout, 332, 344)
	ITEM(EditFile, edfFile1, LeftPosZ(12, 296).TopPosZ(12, 19))
END_LAYOUT


mr_ped wrote on Fri, 11 February 2011 11:50

PS. will try to improve the guide, you are right, it's missing there, but need some spare time. Smile

Yes, time is always a problem !
... But if you do, maybe you'll loose less time to answer beginner's questions Wink



Re: How to add controls from bazaar in my apps ? [message #31172 is a reply to message #31171] Fri, 11 February 2011 14:46 Go to previous messageGo to next message
unknown user
Hi,

You're missing #include <Controls4U/Controls4U.h> in TestEditFile.h
//...
#include <CtrlLib/CtrlLib.h>
#include <Controls4U/Controls4U.h>
using namespace Upp;


If you use some widget in *.lay files then you'll have to get it into the scope (include it's file) before *.lay include.
// I.e.:
#include <SomeHeader>

// SomeWidget will be used in .lay file
#define LAYOUTFILE <testEditFile/testEditFile.lay>
#include <CtrlCore/lay.h>


Andrei
Re: How to add controls from bazaar in my apps ? [message #31173 is a reply to message #31171] Fri, 11 February 2011 14:48 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Embarassed Sorry, I just forgot to include Controls4U.h !!!

I have now the window with my EditFile, I'll try to use it to open a file...
Re: How to add controls from bazaar in my apps ? [message #31179 is a reply to message #31165] Fri, 11 February 2011 17:27 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
enjoy. Smile
Re: How to add controls from bazaar in my apps ? [message #31187 is a reply to message #31179] Fri, 11 February 2011 22:47 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Smile Smile

Best regards
Iñaki
Re: How to add controls from bazaar in my apps ? [message #31189 is a reply to message #31165] Fri, 11 February 2011 23:02 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Sorry and thank you, andreincx. I didn't see your post...

Yes, it's important to have the right includes at the right place. Especially, the include of Controls4U must be before the namespace line.

All works fine now. Thanks to everybody who helped, and to koldo for those nice controls Smile

[Updated on: Fri, 11 February 2011 23:03]

Report message to a moderator

Re: How to add controls from bazaar in my apps ? [message #31190 is a reply to message #31189] Fri, 11 February 2011 23:19 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Beji

Welcome back!

AFAIK, Controls4U.h include can be before or after namespace. In fact, in Controls4U_demo, it is after namespace.

As Andrei says, it is necessary to put it before this:

#define LAYOUTFILE <testEditFile/testEditFile.lay>
#include <CtrlCore/lay.h>

, because testEditFile.lay uses classes declared in CtrlLib.h and Controls4U.h.


Best regards
Iñaki

[Updated on: Fri, 11 February 2011 23:19]

Report message to a moderator

Re: How to add controls from bazaar in my apps ? [message #31205 is a reply to message #31165] Mon, 14 February 2011 11:05 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi koldo,

Yes, you're right : including Controls4U.h after namespace works well. I made so many tries that probably I made something wrong when I tested after the namespace Embarassed
Re: How to add controls from bazaar in my apps ? [message #31207 is a reply to message #31205] Mon, 14 February 2011 11:13 Go to previous message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Smile

Best regards
Iñaki
Previous Topic: Upp and OpenSceneGraph
Next Topic: Introduction (Howard Lee Harkness)
Goto Forum:
  


Current Time: Fri Apr 19 01:16:05 CEST 2024

Total time taken to generate the page: 0.03081 seconds