Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Window without title bar
Re: Window without title bar [message #14131 is a reply to message #14130] |
Wed, 13 February 2008 21:06 |
Werner
Messages: 234 Registered: May 2006 Location: Cologne / Germany
|
Experienced Member |
|
|
Meanwhile I finished my "single"-ruminations.
At the same time I improved my popup-window test application.
Perhaps the code is interesting to you because it deals with the possible GUI effects "slide" and "fade".
Here it is:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
class PopUpWin : public LineEdit
{
private:
bool poppedUp_;
void RightDown(Point p, dword keyFlags)
{
Close();
poppedUp_ = false;
}
public:
PopUpWin() : poppedUp_(false) { }
void SetPoppedUp(bool yesNo) { poppedUp_ = yesNo; }
bool IsPoppedUp() const { return poppedUp_; }
};
class MainWin : public TopWindow
{
private:
typedef MainWin CLASSNAME;
void NoEffect()
{
Single<PopUpWin>().SetPoppedUp(true);
Single<PopUpWin>().SetRect(300, 300, 600, 400);
Single<PopUpWin>().SetColor(TextCtrl::PAPER_NORMAL, White);
Single<PopUpWin>().SetColor(TextCtrl::INK_NORMAL, Black);
Single<PopUpWin>().PopUp
(
this, // Ctrl* owner = NULL
true, // bool savebits = true
true, // bool activate = true
true, // bool dropshadow = false
false // bool topmost = false
);
}
void SlideEffect()
{
Single<PopUpWin>().SetPoppedUp(true);
Single<PopUpWin>().SetRect(300, 300, 6, 4);
Single<PopUpWin>().SetColor(TextCtrl::PAPER_NORMAL, White);
Single<PopUpWin>().SetColor(TextCtrl::INK_NORMAL, Black);
Single<PopUpWin>().PopUp
(
this, // Ctrl* owner = NULL
true, // bool savebits = true
true, // bool activate = true
true, // bool dropshadow = false
false // bool topmost = false
);
Ctrl::ProcessEvents();
Animate(Single<PopUpWin>(), RectC(300, 300, 600, 400), GUIEFFECT_SLIDE);
}
void FadeEffect()
{
Single<PopUpWin>().SetPoppedUp(true);
Single<PopUpWin>().SetRect(300, 300, 600, 400);
Single<PopUpWin>().SetColor(TextCtrl::PAPER_NORMAL, White);
Single<PopUpWin>().SetColor(TextCtrl::INK_NORMAL, Black);
Single<PopUpWin>().PopUp
(
this, // Ctrl* owner = NULL
true, // bool savebits = true
true, // bool activate = true
true, // bool dropshadow = false
false // bool topmost = false
);
Ctrl::ProcessEvents();
Animate(Single<PopUpWin>(), RectC(300, 300, 600, 400), GUIEFFECT_FADE);
}
void local_menu(Bar& bar)
{
MenuBar local_menu;
bar.Add("no effect", THISBACK(NoEffect));
bar.Add("slide effect", THISBACK(SlideEffect));
bar.Add("fade effect", THISBACK(FadeEffect));
local_menu.Execute();
}
void LeftDown(Point p, dword keyFlags)
{
if (Single<PopUpWin>().IsPoppedUp())
return;
MenuBar::Execute(THISBACK(local_menu));
}
};
GUI_APP_MAIN
{
MainWin mainWin;
mainWin.SetRect(0, 0, 800, 600);
mainWin.Run();
}
Werner
[Updated on: Wed, 13 February 2008 21:10] Report message to a moderator
|
|
|
|
|
Window without title bar
By: DoggyDog on Tue, 12 February 2008 16:48
|
|
|
Re: Window without title bar
By: DoggyDog on Wed, 13 February 2008 12:37
|
|
|
Re: Window without title bar
|
|
|
Re: Window without title bar
By: DoggyDog on Wed, 13 February 2008 13:02
|
|
|
Re: Window without title bar
By: DoggyDog on Wed, 13 February 2008 13:54
|
|
|
Re: Window without title bar
By: Werner on Wed, 13 February 2008 16:41
|
|
|
Re: Window without title bar
By: DoggyDog on Wed, 13 February 2008 17:16
|
|
|
Re: Window without title bar
By: Werner on Wed, 13 February 2008 21:06
|
|
|
Re: Window without title bar
By: DoggyDog on Thu, 14 February 2008 13:15
|
|
|
Re: Window without title bar
By: Werner on Thu, 14 February 2008 13:38
|
|
|
Re: Window without title bar
By: mr_ped on Thu, 14 February 2008 16:15
|
|
|
Re: Window without title bar
By: mrjt on Thu, 14 February 2008 16:18
|
|
|
Re: Window without title bar
|
|
|
Re: Window without title bar
By: Werner on Thu, 14 February 2008 18:54
|
|
|
Re: Window without title bar
By: Werner on Thu, 14 February 2008 22:06
|
|
|
Re: Window without title bar
By: mr_ped on Thu, 14 February 2008 18:07
|
Goto Forum:
Current Time: Sun Apr 28 18:03:22 CEST 2024
Total time taken to generate the page: 0.04538 seconds
|