X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/d50c2df3a49fc88945948331821b4eb09e2919f8..37404b15e859e009df0e737c93e8717ca8d5f3be:/mac/macctrls.c diff --git a/mac/macctrls.c b/mac/macctrls.c index 16c6ee11..9e0ac1d0 100644 --- a/mac/macctrls.c +++ b/mac/macctrls.c @@ -1,4 +1,4 @@ -/* $Id: macctrls.c,v 1.33 2003/04/13 14:37:07 ben Exp $ */ +/* $Id: macctrls.c,v 1.36 2003/04/14 22:55:12 ben Exp $ */ /* * Copyright (c) 2003 Ben Harris * All rights reserved. @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -1264,7 +1265,14 @@ void macctrl_key(WindowPtr window, EventRecord *event) HandleControlKey(control, (event->message & keyCodeMask) >> 8, event->message & charCodeMask, event->modifiers); mc = (union macctrl *)GetControlReference(control); - ctrlevent(mcs, mc, EVENT_VALCHANGE); + switch (mc->generic.type) { + case MACCTRL_LISTBOX: + ctrlevent(mcs, mc, EVENT_SELCHANGE); + break; + default: + ctrlevent(mcs, mc, EVENT_VALCHANGE); + break; + } } } #if !TARGET_API_MAC_CARBON @@ -1939,14 +1947,34 @@ void printer_finish_enum(printer_enum *pe) void dlg_coloursel_start(union control *ctrl, void *dlg, int r, int g, int b) { + struct macctrls *mcs = dlg; + union macctrl *mc = findbyctrl(mcs, ctrl); + Point where = {-1, -1}; /* Screen with greatest colour depth */ + RGBColor incolour; + if (HAVE_COLOR_QD()) { + incolour.red = r * 0x0101; + incolour.green = g * 0x0101; + incolour.blue = b * 0x0101; + mcs->gotcolour = GetColor(where, "\pModify Colour:", &incolour, + &mcs->thecolour); + ctrlevent(mcs, mc, EVENT_CALLBACK); + } else + dlg_beep(dlg); } int dlg_coloursel_results(union control *ctrl, void *dlg, int *r, int *g, int *b) { + struct macctrls *mcs = dlg; - return 0; + if (mcs->gotcolour) { + *r = mcs->thecolour.red >> 8; + *g = mcs->thecolour.green >> 8; + *b = mcs->thecolour.blue >> 8; + return 1; + } else + return 0; } /*