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 » U++ community news and announcements » U++ with GTK backend is now able to use native GTK file chooser
U++ with GTK backend is now able to use native GTK file chooser [message #39252] Tue, 05 March 2013 20:23 Go to next message
mirek is currently offline  mirek
Messages: 13428
Registered: November 2005
Ultimate Member
..in other words, FileSel, which so far only worked in Win32 and invoked standard Win32 file selector, now works in U++/Gtk too, with mostly similiar interface to Win32 FileSel.
Re: U++ with GTK backend is now able to use native GTK file chooser [message #39261 is a reply to message #39252] Wed, 06 March 2013 22:17 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Cool! Thank you very much!
Re: U++ with GTK backend is now able to use native GTK file chooser [message #40169 is a reply to message #39252] Wed, 26 June 2013 15:35 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 882
Registered: September 2012
Location: Poland, Kraków
Experienced Contributor
It seems it dosen't work on Kubuntu/Ubuntu. Can you check the code fragment with platform preprocesor? I have enclosed exemplary code that works on Linux (CtrlLib/CtrlUtil.h - line 339):

#ifdef PLATFORM_X11

#ifdef flagNOGTK
typedef FileSel FileSelector;
#else
class FileSelector {
	Vector<String> path;
	Vector< Tuple2<String, String> > type;
	
	String ipath;
	bool   confirm;
	bool   multi;
	bool   hidden;
	int    activetype;

public:
	bool   Execute(bool open, const char *title = NULL);
	bool   ExecuteOpen(const char *title = NULL)          { return Execute(true, title); }
	bool   ExecuteSaveAs(const char *title = NULL)        { return Execute(false, title); }

	String Get() const                                    { return path.GetCount() ? path[0] : String::GetVoid(); }
	operator String() const                               { return Get(); }
	String operator~() const                              { return Get(); }
	
	void   Set(const String& s)                           { ipath = s; }
	void   operator=(const String& s)                     { Set(s); }
	void   operator<<=(const String& s)                   { Set(s); }

	int    GetCount() const                               { return path.GetCount(); }
	const  String& operator[](int i) const                { return path[i]; }

	FileSelector& Type(const char *name, const char *ext) { type.Add(MakeTuple(String(name), String(ext))); return *this; }
	FileSelector& AllFilesType();
	FileSelector& Asking(bool b = true)                   { confirm = b; return *this; }
	FileSelector& NoAsking()                              { return Asking(false); }
	FileSelector& Multi(bool b = true)                    { multi = b; return *this; }
	FileSelector& ShowHidden(bool b = true)               { hidden = b; return *this; }
	FileSelector& ActiveDir(const String& dir)            { ipath = dir; return *this; }
	FileSelector& ActiveType(int i)                       { activetype = i; return *this; }

	FileSelector();
};
#endif

#endif


After that I have missing headers error and one small compilation error (after including headers) with following file: Gtk.cpp. Can you check it?

Here is the error message:
/home/klugier/upp/uppsrc/CtrlLib/Gtk.cpp:26:60: error: ‘class Upp::Ctrl’ has no member named ‘gtk’


Sincerely,
Klugier


Ultimate++ - one framework to rule them all.

[Updated on: Wed, 26 June 2013 19:42]

Report message to a moderator

Re: U++ with GTK backend is now able to use native GTK file chooser [message #40171 is a reply to message #40169] Wed, 26 June 2013 19:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13428
Registered: November 2005
Ultimate Member
Please notice "GTK backend" in Title.

It only works with GTK backend. For now, you can activate it by adding GTK flag to main config or to "fixed flags" in Build methods.
Re: U++ with GTK backend is now able to use native GTK file chooser [message #40172 is a reply to message #40171] Wed, 26 June 2013 22:06 Go to previous message
Klugier is currently offline  Klugier
Messages: 882
Registered: September 2012
Location: Poland, Kraków
Experienced Contributor
Thank you for information.

Sincerely,
Klugier


Ultimate++ - one framework to rule them all.
Previous Topic: CtrlLib: Calendar, DropDate: Fixed issue with end of month clicks, WhenWeek
Next Topic: Debian repository
Goto Forum:
  


Current Time: Sun Sep 26 23:45:11 CEST 2021

Total time taken to generate the page: 0.01072 seconds