X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2FWM%2Fdecorator.c;h=d30eadccdbcc7cf524372dc717062782a8c76ba0;hb=d778bb605479493d104540cd25f7822adee24b82;hp=14c041477b231ff377a74f024e6d560e19f17fe2;hpb=11dbd684e9a3d907d43d71a3145205f1a86992fb;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/WM/decorator.c b/Usermode/Applications/axwin3_src/WM/decorator.c index 14c04147..d30eadcc 100644 --- a/Usermode/Applications/axwin3_src/WM/decorator.c +++ b/Usermode/Applications/axwin3_src/WM/decorator.c @@ -129,22 +129,38 @@ void Decorator_Redraw(tWindow *Window) ciSideBorderWidth*2+Window->W, ciBottomBorderWidth-1, cColour_BottomBorder ); + + // Buttons + // TODO: Conditional for each } int Decorator_HandleMessage(tWindow *Window, int Message, int Length, const void *Data) { + static tWindow *btn1_down; switch(Message) { case WNDMSG_MOUSEMOVE: { const struct sWndMsg_MouseMove *msg = Data; + + if( btn1_down == Window ) { + WM_MoveWindow(Window, Window->X + msg->dX, Window->Y + msg->dY); + return 0; + } + if(msg->Y >= 0) return 1; // Pass - + // TODO: Handle return 0; } case WNDMSG_MOUSEBTN: { const struct sWndMsg_MouseButton *msg = Data; + if( msg->Button == 0 && !msg->bPressed ) + btn1_down = 0; + if(msg->Y >= 0) return 1; // Pass - + + if( msg->Button == 0 && msg->bPressed ) + btn1_down = Window; + // TODO: Handle return 0; } default: // Anything unhandled is passed on