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 » U++ Library support » U++ Library : Other (not classified elsewhere) » [Feature request] Libraries!
[Feature request] Libraries! [message #6892] Sun, 03 December 2006 20:16 Go to next message
g00fy is currently offline  g00fy
Messages: 15
Registered: December 2006
Location: Mechelen, Belgium, Europe
Promising Member
Hi all,


Maybe the title is somehow obscure because U++ IS a library, but what I mean is... I would like some way to compile it into a .lib (MS Visual Studio), a .dll (Windows), a .so (Linux), an .a (mingw), ...

Maybe it's already possible, I don't really know...

I just came from wxWidgets and I have to say it's rather simple... After you read through the code Wink. I was having difficulties with placing an Image in the TrayArea Smile. But one thing I have to say is that wxWidgets might be bigger... It's MUCH more extensible, and supports a lot more platforms. The comparison is a little flawed I think because wx 'looks' better. And no, I am not here to start some flamewar, I am just asking for libraries Wink.

One thing that eludes me is all these codes you can put in prompts. Before I was used to call a messagebox like

wxMessageBox(const wxString& message, const wxString& caption = "Message", int style = wxOK,
wxWindow *parent = NULL, int x = -1, int y = -1)


And now it's like
PromptOK, PromptAbortRetry, ... (or Prompt & tell it yourselves)


But so far I couldn't get it to center on my screen and show above every application.

So I made there this tray-hello-icon program, and doubleclicked the trayicon... The promptok-message prompted below every window! (and I had like 20 open), so I saw it was opened, but it didn't show Smile.

Pretty fast and nifty library I think once I'll get the hang of it, but not entirely mature I guess?

Oh, did I say I really miss libraries? Rolling Eyes


Greetz!


EDIT:
BTW, the IDE ROCKS! It's the best opensource IDE I have ever seen... Little rough on the edges, but really really good!

EDIT2:
#include "TrayIcon.h"

#define IMAGECLASS Tray
#define IMAGEFILE  "Bombs.iml"
#include <Draw/iml.h>
 
struct App : TrayIcon {
    void Info() {
//        Icon(Tray::Icon1());
        PromptOK("TrayIcon launched this prompt!");
//        Icon(Tray::Icon());
    }
 
    void Menu(Bar& bar) {
        bar.Add("Info..", THISBACK(Info));
        bar.Separator();
        bar.Add("Exit", THISBACK(Break));
    }
 
    typedef App CLASSNAME;
 
    App() {
        WhenBar = THISBACK(Menu);
        WhenLeftDouble = THISBACK(Info);
        Icon(Tray::Small());
        Tip("This is U++ tray icon");
    }
};
 
GUI_APP_MAIN
{
    App().Run();
}


The problem is that when you rightclick on the trayicon, it appears in the left upper corner of the screen. Otherwise it nicely pops up in the middle of the screen. Don't know how to reproduce to pop under every window.

[Updated on: Sun, 03 December 2006 20:22]

Report message to a moderator

Re: [Feature request] Libraries! [message #6893 is a reply to message #6892] Sun, 03 December 2006 20:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13978
Registered: November 2005
Ultimate Member
g00fy wrote on Sun, 03 December 2006 14:16

Hi all,


Maybe the title is somehow obscure because U++ IS a library, but what I mean is... I would like some way to compile it into a .lib (MS Visual Studio), a .dll (Windows), a .so (Linux), an .a (mingw), ...



Well, this request comes once a quarter I think Smile

If build some application in release mode, TheIDE will produce libraries for all packages used. Therefore it should be possible to simply pick them in the output directory and use. (But nobody tried so far...)

Quote:


comparison is a little flawed I think because wx 'looks' better.



If you are using 605 version (latest "stable"), try recent dev version. U++ is now using theming APIs to achieve native look (if that is what you mean by "looks").

Quote:


But so far I couldn't get it to center on my screen and show above every application.

So I made there this tray-hello-icon program, and doubleclicked the trayicon... The promptok-message prompted below every window! (and I had like 20 open), so I saw it was opened, but it didn't show Smile.



Well, TrayIcon is recent addition, there might still be glitches in less frequent scenarios.

If you could post a testcase (single package demonstrating the problem), we might be able to help you (either find a bug in your code or in U++).

EDIT: While I was writing this, you added it Smile OK, will check soon.

Quote:


Pretty fast and nifty library I think once I'll get the hang of it, but not entirely mature I guess?



Define mature Smile It is used for 8 years to develop commercial apps. Of course, newly added stuff like TrayIcon needs time to mature.

Mirek
Re: [Feature request] Libraries! [message #6894 is a reply to message #6893] Sun, 03 December 2006 21:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13978
Registered: November 2005
Ultimate Member
Ok, trayicon problem fixed - it was unfortunate interaction with Win32 API...

Quick fix (will in next dev release tomorrow):

CtrlCore/TopWin32.cpp 112:

void TopWindow::CenterRect(HWND hwnd)
{
	SetupRect();
	if(hwnd && center == 1 || center == 2) {
		Size sz = GetRect().Size();
		Rect frmrc(sz);
	#ifndef PLATFORM_WINCE
		::AdjustWindowRect(frmrc, WS_OVERLAPPEDWINDOW, FALSE);
	#endif
		Rect r, wr;
		wr = Ctrl::GetWorkArea().Deflated(-frmrc.left, -frmrc.top,
			frmrc.right - sz.cx, frmrc.bottom - sz.cy);
		sz.cx = min(sz.cx, wr.Width());
		sz.cy = min(sz.cy, wr.Height());
		if(center == 1) {
			::GetClientRect(hwnd, r);
			if(r.IsEmpty())
				r = wr;
			else {
				Point p = r.TopLeft();
				::ClientToScreen(hwnd, p);
				r.Offset(p);
			}
		}
		else


Mirek
Re: [Feature request] Libraries! [message #6895 is a reply to message #6894] Sun, 03 December 2006 21:37 Go to previous messageGo to next message
g00fy is currently offline  g00fy
Messages: 15
Registered: December 2006
Location: Mechelen, Belgium, Europe
Promising Member
Thx Smile

I'm working on the dev-version... Maybe I will get it from svn/cvs later on... That's how I worked on the wx library.

Maybe tomorrow at work I'll look into creating projects and stuff for U++. Then I'll be able to compile it in whatever I want...


Bug?: Maybe this is another one. Using that application, when the prompt is focussed on the screen, it's not getting the focus, which is weird because i'm used to pressing 'Esc' to remove pesty buggers like that... It's both good and bad. Good because you can't actually click on it. Bad because it's "not default windows behaviour" if you get what I mean.


Greetz,
Steven
Re: [Feature request] Libraries! [message #6896 is a reply to message #6895] Sun, 03 December 2006 21:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13978
Registered: November 2005
Ultimate Member
g00fy wrote on Sun, 03 December 2006 15:37


I'm working on the dev-version... Maybe I will get it from svn/cvs later on... That's how I worked on the wx library.



Well, svn exists only for those who do not want to download complete sources. It is never more up-to-date than latest dev (which is released each week).

Mirek
Re: [Feature request] Libraries! [message #6897 is a reply to message #6896] Sun, 03 December 2006 22:05 Go to previous messageGo to next message
g00fy is currently offline  g00fy
Messages: 15
Registered: December 2006
Location: Mechelen, Belgium, Europe
Promising Member
Ah ok... I thought because I use svn for my projects (and commit like everytime I did something - or when I am about to do something wrong Wink -, that everyone does it like me.


BTW, is the patch system at sf.net being used? I didn't see anyone submitting anything to there (for 8 years of development that's rather little :S).


Tomorrow I'll waste some time creating project-files so I can generate the projects Smile


Greetz,
Steven
Re: [Feature request] Libraries! [message #6898 is a reply to message #6897] Sun, 03 December 2006 22:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13978
Registered: November 2005
Ultimate Member
No. At the moment, we are using sf.net to distribute files only.

Mirek

[Updated on: Sun, 03 December 2006 22:44]

Report message to a moderator

Re: [Feature request] Libraries! [message #6899 is a reply to message #6895] Sun, 03 December 2006 23:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13978
Registered: November 2005
Ultimate Member
g00fy wrote on Sun, 03 December 2006 15:37


Bug?: Maybe this is another one. Using that application, when the prompt is focussed on the screen, it's not getting the focus, which is weird because i'm used to pressing 'Esc' to remove pesty buggers like that... It's both good and bad. Good because you can't actually click on it. Bad because it's "not default windows behaviour" if you get what I mean.



This one drives me crazy. It looks like win32 sets the focus to the window and then does not send keystrokes there:

	Ctrl::Create(parent = 0x0) in struct PromptDlgWnd__ : 0x12f584(hwnd 0x0)
		Ctrl::GetScreenClient: hwnd = 0xF01F0, client = [0, 0] - [251, 94] : (251, 94), screen(tl) = [386, 322], screen(br) = [637, 416]
		WM_MOVE / WM_SIZE: screen client = [386, 322] - [637, 416] : (251, 94)
		Ctrl::WndDestroyCaret()
		Ctrl::GetScreenClient: hwnd = 0xF01F0, client = [0, 0] - [251, 94] : (251, 94), screen(tl) = [386, 322], screen(br) = [637, 416]
		WM_MOVE / WM_SIZE: screen client = [386, 322] - [637, 416] : (251, 94)
		Ctrl::WndDestroyCaret()
		WM_ACTIVATE struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0), wParam = 1, focusCtrlWnd = NULL, raw = 0x0
		WM_SETFOCUS struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0), focusCtrlWnd = NULL, raw = 0xF01F0
		ActivateWnd struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0)
		About to set focus: struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0)
		Do SyncCaret focusCtrl: struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0), caretCtrl: NULL
		Ctrl::WndDestroyCaret()
		Focus: struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0) FocusWnd:struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0)
		//WM_SETFOCUS 0xF01F0, focusCtrlWnd = struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0), raw = 0xF01F0
		Ctrl::GetScreenClient: hwnd = 0xF01F0, client = [0, 0] - [251, 94] : (251, 94), screen(tl) = [386, 322], screen(br) = [637, 416]
	//Ctrl::Create in struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0)
	(void *)::GetActiveWindow() = 0xF01F0
	(void *)top->hwnd = 0xF01F0
	Ctrl::WndEnable(false) in struct App : 0x12fda0(hwnd 0x14029e), focusCtrlWnd = struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0), raw = 0xF01F0
	//Ctrl::WndEnable(false) -> true struct App : 0x12fda0(hwnd 0x14029e), focusCtrlWnd = struct PromptDlgWnd__ : 0x12f584(hwnd 0xf01f0), raw = 0xF01F0
	Entering event loop at level 2


At this moment, Prompt is open on the screen, but pressing keys does nothing (they would be in the log as well). (If Win32 would move focus somewhere else, there would be WM_KILLFOCUS event, but there is none).

I have encountered this behaviour with TrayIcon before, at the moment I am still unsure what is going on.

Mirek
Re: [Feature request] Libraries! [message #6901 is a reply to message #6899] Mon, 04 December 2006 00:36 Go to previous messageGo to next message
g00fy is currently offline  g00fy
Messages: 15
Registered: December 2006
Location: Mechelen, Belgium, Europe
Promising Member
Well,


Over here I get all the keystrokes?

The reason why it doesn't accept 'ESC' as a valid key is because it's a Window. So basically you need to say to it: 'ESC' is a valid key, and it means: Close yourselves. [that's in fact what a Dialog is].


I'm not getting the no-focus behaviour anymore now?


Greetz,
Steven
Re: [Feature request] Libraries! [message #6908 is a reply to message #6901] Mon, 04 December 2006 09:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13978
Registered: November 2005
Ultimate Member
Well, there are in fact two problems:

- if you open prompt by double-click, it has that "no-focus" trouble. I will spend a couple of hours today trying to fix it (and another couple of hours trying to get GTK theme "grand canyon" scollbars displayed correctly Smile

- PromptOK could be closed by pressing Enter only (because it has one OK button). This one I have already fixed (hacked Prompt so that if there is just single OK button, it closes by Esc too). Strange nobody noticed this small trouble yet..

Mirek
Re: [Feature request] Libraries! [message #6916 is a reply to message #6908] Mon, 04 December 2006 13:14 Go to previous messageGo to next message
g00fy is currently offline  g00fy
Messages: 15
Registered: December 2006
Location: Mechelen, Belgium, Europe
Promising Member
Ok,


I double checked how messageboxes are working:

* OK alone: ESC -> removes the messagebox, returns "OK"
* Cancel in the box (for example ok/cancel or yes/no/cancel or ...): ESC -> removes the box, returns "Cancel"
* yes/no: ESC -> Doesn't work.


Greetz,
Steven


void show_msgbox( const wxString& w, int buttons )
{
  int id = wxMessageBox( w, wxMessageBoxCaptionStr, buttons );
  switch( id )
  {
  case wxOK:      wxMessageBox( w + wxT(" -> wxOK") );     break;
  case wxCANCEL:  wxMessageBox( w + wxT(" -> wxCANCEL") ); break;
  case wxYES:     wxMessageBox( w + wxT(" -> wxYES") );    break;
  case wxNO:      wxMessageBox( w + wxT(" -> wxNO") );     break;
  default:
    wxMessageBox( wxString::Format(wxT("%ld"), id ) );
    break;
  }
}

#define wxBOX(a) show_msgbox(wxT(#a), a)
  wxBOX(wxOK);
  wxBOX(wxYES_NO);
  wxBOX(wxYES_NO|wxCANCEL);
  wxBOX(wxOK|wxCANCEL);

[Updated on: Mon, 04 December 2006 13:18]

Report message to a moderator

Re: [Feature request] Libraries! [message #6917 is a reply to message #6916] Mon, 04 December 2006 13:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13978
Registered: November 2005
Ultimate Member
Yes, this is how I altered it now.

Mirek
Re: [Feature request] Libraries! [message #6932 is a reply to message #6895] Tue, 05 December 2006 13:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13978
Registered: November 2005
Ultimate Member
g00fy wrote on Sun, 03 December 2006 15:37


Bug?: Maybe this is another one. Using that application, when the prompt is focussed on the screen, it's not getting the focus, which is weird because i'm used to pressing 'Esc' to remove pesty buggers like that... It's both good and bad. Good because you can't actually click on it. Bad because it's "not default windows behaviour" if you get what I mean.



Ufff... 3 hours to fix that Smile

Mirek
Re: [Feature request] Libraries! [message #6945 is a reply to message #6917] Tue, 05 December 2006 16:21 Go to previous messageGo to next message
g00fy is currently offline  g00fy
Messages: 15
Registered: December 2006
Location: Mechelen, Belgium, Europe
Promising Member
Hi Mirek,


Please find hereby attached some bakefiles I created to create the requested libraries.

Options are:
- GUI/Console
- Debug/Release
- MT/ST

They are especially usefull for people wanting to build their own version of the library in different compilers (should work in nearly every compiler out there).

Also I noticed that when setting warnings to max (/W4 in Visual Studio 2005), I got a LOT - really a LOT - of warnings.


What you need is bakefile: http://bakefile.sf.net, install it, put it in the path. Drop the zip in upp/uppsrc/bakefiles, navigate to it & run 'bakefile_gen' (or 'gen_all.bat'). Then it will generate files in upp/uppsrc.



Greetz,
Steven
  • Attachment: bakefiles.zip
    (Size: 4.71KB, Downloaded 1347 times)

[Updated on: Tue, 05 December 2006 16:21]

Report message to a moderator

Re: [Feature request] Libraries! [message #6946 is a reply to message #6932] Tue, 05 December 2006 16:23 Go to previous messageGo to next message
g00fy is currently offline  g00fy
Messages: 15
Registered: December 2006
Location: Mechelen, Belgium, Europe
Promising Member
luzr wrote on Tue, 05 December 2006 07:00

Ufff... 3 hours to fix that Smile

Mirek


But it's fixed! That's the main point Very Happy. Is it in SVN? Razz *push* *push*
Re: [Feature request] Libraries! [message #7541 is a reply to message #6946] Fri, 05 January 2007 11:47 Go to previous messageGo to next message
Olli is currently offline  Olli
Messages: 1
Registered: January 2007
Location: Braunschweig, Germany
Junior Member
Hi!

g00fy: i can't download those bakefiles, i always get archives with a zero byte size Sad Would you mind uploading them again or mailing them to o.klages@tu-bs.de ? Thank you very much!
Re: [Feature request] Libraries! [message #7542 is a reply to message #7541] Fri, 05 January 2007 12:11 Go to previous message
mirek is currently offline  mirek
Messages: 13978
Registered: November 2005
Ultimate Member
BTW, anybody to volunteer to maintain the library version? (perhaps including docs about how to use them with VS2005).

Mirek
Previous Topic: U++ 612-dev 3 HomeBudget run time problem
Next Topic: assign enum to variable?
Goto Forum:
  


Current Time: Sun May 12 18:01:07 CEST 2024

Total time taken to generate the page: 0.03409 seconds