|
| Shell (unsigned int aMask) |
|
virtual | ~Shell () |
|
virtual void | show () |
|
void | setTitle (const std::string &aString) |
|
void | setGeometry (int aX, int aY, unsigned int aWidth, unsigned int aHeight) |
|
void | setSize (unsigned int aWidth, unsigned int aHeight) |
|
void | setFocusWindow (HWND aWindow) |
|
HWND | focusWindow () |
|
void | setSetFocusCallback (SetFocusCallback aCallback, void *aTag) |
|
void | callSetFocusCallback () |
|
HACCEL | nativeAcceleratorTable () |
|
bool | addAccelerator (const std::string &aString, int aID) |
|
| Component (const std::string &aType) |
|
| Component (const std::string &aType, Component &aParent) |
|
virtual | ~Component () |
|
std::string | name () const |
|
void | setName (const std::string &aName) |
|
const std::string & | type () const |
|
HWND | nativeWindow () |
|
Component * | parent () const |
|
void | hide () |
|
virtual bool | size (unsigned int &aWidth, unsigned int &aHeight) |
|
virtual bool | position (int &aX, int &aY) |
|
Component * | findFather (const std::string &aType) |
|
bool | setBackground (double aR, double aG, double aB) |
|
void | addCallback (const std::string &aName, Callback aFunction, void *aTag) |
|
void | removeCallback (const std::string &aName, Callback aFunction, void *aTag) |
|
bool | executeCallbacks (const std::string &aName, CallbackData &aData) |
|
bool | hasCallbacks (const std::string &aName) const |
|
Definition at line 351 of file WinTk.
◆ Shell() [1/2]
tools::WinTk::Shell::Shell |
( |
unsigned int |
aMask | ) |
|
|
inline |
Definition at line 353 of file WinTk.
356 ,fSetFocusCallback(0)
358 ,fAcceleratorTable(0)
360 static char sWindowClassName[] =
"WinTk::Shell";
361 static bool done =
false;
364 wc.style = CS_HREDRAW | CS_VREDRAW;
365 wc.lpfnWndProc = (WNDPROC)Shell::proc;
368 wc.hInstance = ::GetModuleHandle(NULL);
369 wc.hIcon = LoadIcon(NULL,IDI_APPLICATION);
370 wc.hCursor = LoadCursor(NULL,IDC_ARROW);
371 wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
372 wc.lpszMenuName = sWindowClassName;
373 wc.lpszClassName = sWindowClassName;
374 ::RegisterClass(&wc);
378 fWindow = ::CreateWindow(sWindowClassName,
381 CW_USEDEFAULT,CW_USEDEFAULT,
384 ::GetModuleHandle(NULL),
387 ::SetWindowLongPtr(
fWindow,GWLP_USERDATA,LONG_PTR(
this));
◆ ~Shell()
virtual tools::WinTk::Shell::~Shell |
( |
| ) |
|
|
inlinevirtual |
Definition at line 389 of file WinTk.
390 if(fAcceleratorTable) {
391 ::DestroyAcceleratorTable(fAcceleratorTable);
392 fAcceleratorTable = 0;
◆ Shell() [2/2]
tools::WinTk::Shell::Shell |
( |
Shell & |
a_from | ) |
|
|
inlineprotected |
◆ addAccelerator()
bool tools::WinTk::Shell::addAccelerator |
( |
const std::string & |
aString, |
|
|
int |
aID |
|
) |
| |
|
inline |
Definition at line 444 of file WinTk.
450 std::vector<std::string>
words;
451 std::string s(aString);
454 if(
words.size()==1) {
455 acc.fVirt = FVIRTKEY;
456 if(!string_to_VK(
words[0],acc.key))
return false;
457 }
else if((
words.size()==2)&&(
words[1].size())) {
458 if(
words[0]==
"CTRL") {
459 acc.fVirt = FCONTROL;
460 }
else if(
words[0]==
"ALT") {
462 }
else if(
words[0]==
"SHIFT") {
467 acc.fVirt |= FVIRTKEY;
468 if(!string_to_VK(
words[1],acc.key))
return false;
473 if(!fAcceleratorTable) {
474 fAcceleratorTable = ::CreateAcceleratorTable(&acc,1);
476 int n = ::CopyAcceleratorTable(fAcceleratorTable,NULL,0);
477 ACCEL* tbl =
new ACCEL[n+1];
478 ::CopyAcceleratorTable(fAcceleratorTable,tbl,n);
479 ACCEL& tacc = tbl[n];
480 tacc.fVirt = acc.fVirt;
483 ::DestroyAcceleratorTable(fAcceleratorTable);
484 fAcceleratorTable = ::CreateAcceleratorTable(tbl,n+1);
◆ callSetFocusCallback()
void tools::WinTk::Shell::callSetFocusCallback |
( |
| ) |
|
|
inline |
Definition at line 438 of file WinTk.
439 if(!fSetFocusCallback)
return;
440 fSetFocusCallback(
this,fSetFocusTag);
◆ focusWindow()
HWND tools::WinTk::Shell::focusWindow |
( |
| ) |
|
|
inline |
Definition at line 432 of file WinTk.
432 {
return fFocusWindow;}
◆ nativeAcceleratorTable()
HACCEL tools::WinTk::Shell::nativeAcceleratorTable |
( |
| ) |
|
|
inline |
Definition at line 442 of file WinTk.
442 {
return fAcceleratorTable;}
◆ operator=()
◆ setFocusWindow()
void tools::WinTk::Shell::setFocusWindow |
( |
HWND |
aWindow | ) |
|
|
inline |
Definition at line 431 of file WinTk.
431 {fFocusWindow = aWindow;}
◆ setGeometry()
void tools::WinTk::Shell::setGeometry |
( |
int |
aX, |
|
|
int |
aY, |
|
|
unsigned int |
aWidth, |
|
|
unsigned int |
aHeight |
|
) |
| |
|
inline |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition at line 411 of file WinTk.
416 int hborder = ::GetSystemMetrics(SM_CYCAPTION);
417 if(::GetWindowLongPtr(
fWindow,GWLP_ID))
418 hborder += ::GetSystemMetrics(SM_CYMENU);
419 ::MoveWindow(
fWindow,aX,aY,aWidth,hborder + aHeight,TRUE);
◆ setSetFocusCallback()
void tools::WinTk::Shell::setSetFocusCallback |
( |
SetFocusCallback |
aCallback, |
|
|
void * |
aTag |
|
) |
| |
|
inline |
Definition at line 434 of file WinTk.
435 fSetFocusCallback = aCallback;
◆ setSize()
void tools::WinTk::Shell::setSize |
( |
unsigned int |
aWidth, |
|
|
unsigned int |
aHeight |
|
) |
| |
|
inline |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
Definition at line 421 of file WinTk.
426 int hborder = ::GetSystemMetrics(SM_CYCAPTION);
428 ::GetWindowRect(
fWindow,&rect);
429 ::MoveWindow(
fWindow,rect.left,rect.top,aWidth,hborder + aHeight,TRUE);
◆ setTitle()
void tools::WinTk::Shell::setTitle |
( |
const std::string & |
aString | ) |
|
|
inline |
Definition at line 407 of file WinTk.
409 ::SetWindowText(
fWindow,aString.c_str());
◆ show()
virtual void tools::WinTk::Shell::show |
( |
| ) |
|
|
inlinevirtual |
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/Windows/WinTk