Home » U++ Library support » TopWindow&PopUp, TrayIcon » No title bar and no frame, just Image or Ctrl
No title bar and no frame, just Image or Ctrl [message #2647] |
Wed, 19 April 2006 22:28  |
mezise
Messages: 54 Registered: April 2006
|
Member |
|
|
When I saw Ultimate++ a week ago I've just wanted to start again c++ programming. Great job!
I can't find solution to run animated HelloWorld example only with visible drawing area. Is it possible to do it in convenient way?
Michael
|
|
|
Re: No title bar and no frame, just Image or Ctrl [message #2648 is a reply to message #2647] |
Wed, 19 April 2006 22:57   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
mezise wrote on Wed, 19 April 2006 16:28 | When I saw Ultimate++ a week ago I've just wanted to start again c++ programming. Great job!
I can't find solution to run animated HelloWorld example only with visible drawing area. Is it possible to do it in convenient way?
Michael
|
Like without window caption and window frame ("decorations")?
Well, one possibility is to use popup window instead of TopWindow. In fact, you can even popup the TopWindow..
GUI_APP_MAIN
{
HelloWorld hw;
hw.Title("Hello world example");
hw.Text(Nvl(Join(CommandLine(), " "), "Hello world !"));
hw.SetRect(100, 100, 500, 500);
hw.PopUp();
hw.Run();
}
However, I must warn you that this is quite system dependent. E.g. in X11, popup windows behave a bit differently (and quite oddly).
Mirek
|
|
|
|
|
|
Re: No title bar and no frame, just Image or Ctrl [message #12920 is a reply to message #2647] |
Wed, 28 November 2007 18:12   |
amit
Messages: 17 Registered: November 2007
|
Promising Member |
|
|
I tried to something:
-- the basic idea is to work in CtrlCore::Win32::Win32Proc.cpp
-- in message case : WM_NCHITTEST .
-- add this:
UINT test;
test = DefWindowProc(hwnd, WM_NCHITTEST, wParam, lParam);
if(test == HTCLIENT)
{
return HTCAPTION;
}
else
{
return test;
}
-- the problem starts here, any component added to this window does not receive any of the mouse event.
-- so if someone could guide me to workout a solution where i can know that mouse have been clicked in empty area and not in any child controls, then this could really work.
[Updated on: Wed, 28 November 2007 18:14] Report message to a moderator
|
|
|
|
Re: No title bar and no frame, just Image or Ctrl [message #12932 is a reply to message #12929] |
Thu, 29 November 2007 13:21  |
amit
Messages: 17 Registered: November 2007
|
Promising Member |
|
|
thanks solution works ..
final code section (if any one else want to use it ) :
void xyz::LeftDown(Point pos, dword flags)
{
SetCapture();
last_point = pos;
}
void xyz::MouseMove(Point pos, dword flags)
{
if(HasCapture())
{
int tx;
int ty;
int tcx;
int tcy;
tx = this->GetRect().TopLeft().x + pos.x-last_point.x ; //update the x position by adding the difference moved
ty = this->GetRect().TopLeft().y + pos.y-last_point.y ; //update the y position by adding the difference moved
tcx = this->GetRect().Width();
tcy = this->GetRect().Height();
this->SetRect(tx, ty, tcx, tcy); // set window position
this->Refresh();
}
}
on the little note, i don't know if GetRect() ans SetRect() is used in a optimized manner.
??? ---- one thing i want to ask was abt SetCapture(); was that - do we have to do anything like "Un-SetCapture();" in LeftUp().
also i have placed a picture logo on screen, i tried to use Draw Image in Paint(..) but didn't work well (message #12917) so i used ImageCtrl, now that logo is ImageCrtl (i.e. a conrtol) the logo area can not be used as click&drag client area. maybe i'll make a customized caption-bar later on.
anyway the problem here was solved and working.
thanks a lot.
and one more thing .. third day after using ultimatepp, TheIDE i'll say its simply "the Tool" for RAD and far far far better than any other UI tool or MS orignal stuff.
[Updated on: Thu, 29 November 2007 13:22] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Apr 28 20:30:23 CEST 2025
Total time taken to generate the page: 0.00758 seconds
|