Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [Feature request] Libraries!
[Feature request] Libraries! [message #6892] |
Sun, 03 December 2006 20:16 |
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 . I was having difficulties with placing an Image in the TrayArea . 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 .
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 .
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?
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 |
|
mirek
Messages: 13980 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
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 .
|
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 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 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 |
|
mirek
Messages: 13980 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 #6899 is a reply to message #6895] |
Sun, 03 December 2006 23:35 |
|
mirek
Messages: 13980 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 #6916 is a reply to message #6908] |
Mon, 04 December 2006 13:14 |
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 #6945 is a reply to message #6917] |
Tue, 05 December 2006 16:21 |
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
[Updated on: Tue, 05 December 2006 16:21] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Thu May 23 16:26:14 CEST 2024
Total time taken to generate the page: 0.02006 seconds
|