X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2Flibaxwin3.so_src%2Fr_widget.c;h=22a934bbb70ccc1a0728daa1073c5fbe5bd211cc;hb=6397a743456a11e9c38b7e2cf46f41b2b7083365;hp=62e42779c9fb91871c8c60e2ae5db6b0ca4fbc33;hpb=04a050f42807686dc119838c82372409246d55bb;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/libaxwin3.so_src/r_widget.c b/Usermode/Applications/axwin3_src/libaxwin3.so_src/r_widget.c index 62e42779..22a934bb 100644 --- a/Usermode/Applications/axwin3_src/libaxwin3.so_src/r_widget.c +++ b/Usermode/Applications/axwin3_src/libaxwin3.so_src/r_widget.c @@ -12,6 +12,9 @@ #include #include +//static const int ciBaseElementCount = 16; +static const int ciStepElementCount = 16; + // === STRUCTURES === struct sAxWin3_Widget { @@ -58,11 +61,10 @@ uint32_t AxWin3_Widget_int_AllocateID(tWidgetWindowInfo *Info) } if( newID == Info->nElements ) { - const int size_step = 4; - Info->nElements += 4; + Info->nElements += ciStepElementCount; Info->Elements = realloc(Info->Elements, sizeof(*Info->Elements)*Info->nElements); - newID = Info->nElements - 4; - memset( &Info->Elements[newID+1], 0, (size_step-1)*sizeof(Info->Elements)); + newID = Info->nElements - ciStepElementCount; + memset( &Info->Elements[newID+1], 0, (ciStepElementCount-1)*sizeof(Info->Elements)); _SysDebug("Widget: Expanded to %i and allocated %i", Info->nElements, newID); } else @@ -79,12 +81,19 @@ int AxWin3_Widget_MessageHandler(tHWND Window, int MessageID, int Size, void *Da switch(MessageID) { +// case WNDMSG_DESTROY: { +// return 0; } case MSG_WIDGET_FIRE: { tWidgetMsg_Fire *msg = Data; if(Size < sizeof(*msg)) return -1; widget = AxWin3_Widget_int_GetElementByID(Window, msg->WidgetID); if(widget->Fire) widget->Fire(widget); + return 1; } + case MSG_WIDGET_KEYPRESS: { + return 0; } + case MSG_WIDGET_MOUSEBTN: { + // TODO: Do something return 1; } default: return 0;