ultimatepp/uppdev/src/support/Ctrl.h
cxl 351994a6cc Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-08-15 08:36:24 +00:00

68 lines
1.8 KiB
C++

#ifndef _src_support_Ctrl_h_
#define _src_support_Ctrl_h_
#include <Core/Core.h>
#include <CtrlLib/CtrlLib.h>
#include <CtrlCore/CtrlCore.h>
#include <CtrlLib/CtrlLib.h>
#define IMAGECLASS commonImg
#define IMAGEFILE <src/support/common.iml>
#include <Draw/iml_header.h>
#define IMAGECLASS commonImg
#define IMAGEFILE <src/support/common.iml>
#include <Draw/iml_source.h>
// layout
#define LAYOUTFILE <src/support/Ctrl.lay>
#include <CtrlCore/lay.h>
bool DropSelect(String& s, const char *title, const char *label, const Vector<String>& lst);
bool PromptPanelOKCancel(const String& tag, const String& text);
class SupDropList : public DropList {
protected:
int PreviousIndex;
int CurrIndex;
Callback _action;
private:
void KeepCurrIndex() { PreviousIndex=CurrIndex; CurrIndex=GetIndex(); return; }
void NewAction() { KeepCurrIndex(); _action(); return; }
public:
// methods
void GoBackPrevious() { if(PreviousIndex>=0) SetIndex(PreviousIndex); }
void SetIndex(int i) { SetData(GetKey(i)); KeepCurrIndex(); }
// operators overload
Callback operator<<=(Callback action) { _action=action; WhenAction=THISBACK(NewAction); return _action; }
Callback& operator<<(Callback action) { _action=action; return WhenAction<<THISBACK(NewAction); }
typedef SupDropList CLASSNAME;
// constructor
SupDropList() { PreviousIndex = -1; CurrIndex = -1; }
};
/*
class MyVectorText : public VectorRect {
public:
typedef MyVectorText CLASSNAME;
MyVectorText();
};
class MyVectorLine : public VectorLine {
public:
typedef MyVectorLine CLASSNANE;
MyVectorLine() { BeginCap(0).EndCap(0); }
};
*/
Zoom ZoomP(Ctrl &ctrl, int percent);
#endif