document
This commit is contained in:
parent
0e358d20d5
commit
b6c2b7f164
2 changed files with 10 additions and 1 deletions
|
|
@ -19,8 +19,10 @@ namespace MwCXX {
|
|||
void SetText(MwCXX::String value);
|
||||
|
||||
virtual void OnLayout(int value) {};
|
||||
virtual void OnDocumentActivate(MwCXX::String value) {};
|
||||
|
||||
void (*LayoutHandler)(MwCXX::Document* widget, int value);
|
||||
void (*DocumentActivateHandler)(MwCXX::Document* widget, MwCXX::String value);
|
||||
};
|
||||
}; // namespace MwCXX
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,15 @@ static void __OnLayout(MwWidget handle, void* user, void* call) {
|
|||
if(((MwCXX::Document*)user)->LayoutHandler != NULL) ((MwCXX::Document*)user)->LayoutHandler((MwCXX::Document*)user, *(int*)call);
|
||||
}
|
||||
|
||||
static void __OnDocumentActivate(MwWidget handle, void* user, void* call) {
|
||||
((MwCXX::Document*)user)->OnDocumentActivate((MwCXX::String)(char*)call);
|
||||
if(((MwCXX::Document*)user)->DocumentActivateHandler != NULL) ((MwCXX::Document*)user)->DocumentActivateHandler((MwCXX::Document*)user, (MwCXX::String)(char*)call);
|
||||
}
|
||||
|
||||
void MwCXX::Document::RegisterHandlers() {
|
||||
MwAddUserHandler(this->widget, MwNlayoutHandler, __OnLayout, (void*)this);
|
||||
MwAddUserHandler(this->widget, MwNdocumentActivateHandler, __OnDocumentActivate, (void*)this);
|
||||
|
||||
this->LayoutHandler = NULL;
|
||||
this->LayoutHandler = NULL;
|
||||
this->DocumentActivateHandler = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue