Home » U++ Library support » U++ Widgets - General questions or Mixed problems » why the ctrl does`t have HWND?
Re: why the ctrl does`t have HWND? [message #46399 is a reply to message #46398] |
Thu, 05 May 2016 04:56   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
Still very primitive, but you can get some idea.
Not all State (reason) needs to be taken care of. Seems it's fine if you only do the POSITION case.
Flicks, flicks, flicks. Let's see if somebody can make it smoother.
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
class MyPopup : public Ctrl
{
public:
virtual void Paint(Draw& w)
{
w.DrawText(10,20,String().Cat()<<"Daw in the faked Ctrl,"
" my HWND is"<<GetHWND(),StdFont(),White());
}
};
class PopupHolder : public Ctrl
{
public:
void Reset()
{
if(!GetTopCtrl())
return;
popup.Close();
popup.SetRect( GetRect() + this->GetTopCtrl()->GetScreenRect().TopLeft() );
popup.PopUp(this,true,false);
}
virtual void State(int reason)
{
switch(reason)
{
// FOCUS = 10,
case ACTIVATE: // = 11,
LOG("ACTIVATE");
Reset();
break;
case DEACTIVATE:// = 12,
LOG("DEACTIVATE");
popup.Close();
break;
case SHOW:// = 13,
LOG("SHOW");
Reset();
break;
// ENABLE = 14,
// EDITABLE = 15,
case OPEN:// = 16,
LOG("OPEN");
Reset();
break;
case CLOSE:// = 17,
LOG("CLOSE");
popup.Close();
break;
case POSITION:// = 100,
LOG("Position");
Reset();
break;
case LAYOUTPOS:// = 101,
LOG("LAYOUTPOS");
Reset();
break;
}
}
MyPopup popup;
};
struct MyApp: public TopWindow
{
MyApp()
{
//Add(e.LeftPos(30,600).TopPos(40,400));
Add(h.SizePos());
}
PopupHolder h;
typedef MyApp CLASSNAME;
};
GUI_APP_MAIN
{
MyApp().MinimizeBox().MaximizeBox().Sizeable().Run();
}
[Updated on: Thu, 05 May 2016 04:59] Report message to a moderator
|
|
|
 |
|
why the ctrl does`t have HWND?
By: akebee on Wed, 04 May 2016 12:18
|
 |
|
Re: why the ctrl does`t have HWND?
By: Lance on Wed, 04 May 2016 22:24
|
 |
|
Re: why the ctrl does`t have HWND?
By: akebee on Thu, 05 May 2016 02:39
|
 |
|
Re: why the ctrl does`t have HWND?
By: akebee on Thu, 05 May 2016 03:11
|
 |
|
Re: why the ctrl does`t have HWND?
By: Lance on Thu, 05 May 2016 03:30
|
 |
|
Re: why the ctrl does`t have HWND?
By: Lance on Thu, 05 May 2016 04:08
|
 |
|
Re: why the ctrl does`t have HWND?
By: Lance on Thu, 05 May 2016 04:56
|
 |
|
Re: why the ctrl does`t have HWND?
By: akebee on Thu, 05 May 2016 08:50
|
 |
|
Re: why the ctrl does`t have HWND?
By: Lance on Thu, 05 May 2016 12:20
|
 |
|
Re: why the ctrl does`t have HWND?
By: akebee on Tue, 10 May 2016 10:26
|
 |
|
Re: why the ctrl does`t have HWND?
|
 |
|
Re: why the ctrl does`t have HWND?
By: akebee on Tue, 10 May 2016 10:50
|
 |
|
Re: why the ctrl does`t have HWND?
|
Goto Forum:
Current Time: Sat May 10 18:44:10 CEST 2025
Total time taken to generate the page: 0.00626 seconds
|