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 » 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 Go to next message
mezise is currently offline  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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
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 #2650 is a reply to message #2648] Thu, 20 April 2006 01:03 Go to previous messageGo to next message
mezise is currently offline  mezise
Messages: 54
Registered: April 2006
Member
Thanks,
hw.PopUp()
is what I need Smile

And about
hw.SetRect(100, 100, 500, 500);

how may I get a whole available screen width and height to put popup window in the right-bottom corner?

May application be aware of events outside such popup window, for example of mouse events (cursor position, etc.)?

[Updated on: Thu, 20 April 2006 01:05]

Report message to a moderator

Re: No title bar and no frame, just Image or Ctrl [message #2651 is a reply to message #2650] Thu, 20 April 2006 02:34 Go to previous messageGo to next message
mezise is currently offline  mezise
Messages: 54
Registered: April 2006
Member
Finally! I have found appropriate API Smile
GUI_APP_MAIN
{
	HelloWorld hw;
	hw.Title("Hello world example");
	hw.Text(Nvl(Join(CommandLine(), " "), "Hello world !"));
	Size s = hw.GetMaxSize(); // Maximum available width (cx) and height (cy)
	hw.SetRect(s.cx - 210, s.cy - 110, 200, 100);
	hw.PopUp();
	hw.Run();
}

[Updated on: Thu, 20 April 2006 02:36]

Report message to a moderator

Re: No title bar and no frame, just Image or Ctrl [message #12918 is a reply to message #2647] Wed, 28 November 2007 13:33 Go to previous messageGo to next message
amit is currently offline  amit
Messages: 17
Registered: November 2007
Promising Member
hi,
the solution was just what i needed but ...

1) how can i move the window (i would be using the client area to move);
2) i there any predefined way to make it possible to move window move using client area?

[Updated on: Wed, 28 November 2007 13:33]

Report message to a moderator

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 Go to previous messageGo to next message
amit is currently offline  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 #12929 is a reply to message #12918] Thu, 29 November 2007 05:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
amit wrote on Wed, 28 November 2007 07:33

hi,
the solution was just what i needed but ...

1) how can i move the window (i would be using the client area to move);
2) i there any predefined way to make it possible to move window move using client area?


1. Using SetRect.

2. Predefined no. But not that hard to implement within existing U++ interfaces. I assume you want to use "click&drag": Use SetCapture in LeftDown and perhaps setup some flag in instance (sometimes capture alone will do). Then in MouseMove, use SetRect.

Mirek
icon14.gif  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 Go to previous message
amit is currently offline  amit
Messages: 17
Registered: November 2007
Promising Member
thanks solution works ..

final code section (if any one else want to use it Smile ) :


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

Previous Topic: How to force form to be resizable only in 1 direction
Next Topic: region defined windows or Rounded rectangle windows
Goto Forum:
  


Current Time: Fri Mar 29 14:21:45 CET 2024

Total time taken to generate the page: 0.01826 seconds