Index: src/glyphs-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-msw.c,v retrieving revision 1.21.2.10 diff -u -u -r1.21.2.10 glyphs-msw.c --- src/glyphs-msw.c 1998/12/30 01:22:07 1.21.2.10 +++ src/glyphs-msw.c 1999/01/04 17:30:21 @@ -64,6 +64,7 @@ DEFINE_DEVICE_IIFORMAT (mswindows, label); DEFINE_DEVICE_IIFORMAT (mswindows, scrollbar); DEFINE_DEVICE_IIFORMAT (mswindows, combo); +DEFINE_DEVICE_IIFORMAT (mswindows, progress); DEFINE_IMAGE_INSTANTIATOR_FORMAT (bmp); Lisp_Object Qbmp; @@ -2221,6 +2222,38 @@ WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT); } +/* instantiate an edit control */ +static void +mswindows_progress_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, + Lisp_Object pointer_fg, Lisp_Object pointer_bg, + int dest_mask, Lisp_Object domain) +{ + HWND wnd; + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, + pointer_bg, dest_mask, domain, PROGRESS_CLASS, + WS_TABSTOP | WS_BORDER | PBS_SMOOTH, + WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT); + wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); + /* set the colors */ +#ifdef PBS_SETBKCOLOR + SendMessage (wnd, PBS_SETBKCOLOR, 0, + (LPARAM) (COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_BACKGROUND + (XIMAGE_INSTANCE_WIDGET_FACE (ii), + XIMAGE_INSTANCE_SUBWINDOW_FRAME (ii)))))); +#endif +#ifdef PBS_SETBARCOLOR + SendMessage (wnd, PBS_SETBARCOLOR, 0, + (L:PARAM) (COLOR_INSTANCE_MSWINDOWS_COLOR + (XCOLOR_INSTANCE + (FACE_FOREGROUND + (XIMAGE_INSTANCE_WIDGET_FACE (ii), + XIMAGE_INSTANCE_SUBWINDOW_FRAME (ii)))))); +#endif +} + /* instantiate a static control possible for putting other things in */ static void mswindows_label_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, @@ -2303,7 +2336,7 @@ struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* get the text from a control */ - if (EQ (prop, Qtext)) + if (EQ (prop, Q_text)) { Extcount len = SendMessage (wnd, WM_GETTEXTLENGTH, 0, 0); Extbyte* buf =alloca (len+1); @@ -2321,7 +2354,7 @@ struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* check the state of a button */ - if (EQ (prop, Qselected)) + if (EQ (prop, Q_selected)) { if (SendMessage (wnd, BM_GETSTATE, 0, 0) & BST_CHECKED) return Qt; @@ -2338,7 +2371,7 @@ struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); /* get the text from a control */ - if (EQ (prop, Qtext)) + if (EQ (prop, Q_text)) { long item = SendMessage (wnd, CB_GETCURSEL, 0, 0); Extcount len = SendMessage (wnd, CB_GETLBTEXTLEN, (WPARAM)item, 0); @@ -2356,7 +2389,7 @@ { struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - if (EQ (prop, Qtext)) + if (EQ (prop, Q_text)) { Extbyte* lparam=0; CHECK_STRING (val); @@ -2368,6 +2401,23 @@ return Qunbound; } +/* set the properties of a progres guage */ +static Lisp_Object +mswindows_progress_set_property (Lisp_Object image_instance, Lisp_Object prop, + Lisp_Object val) +{ + struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); + + if (EQ (prop, Q_percent)) + { + CHECK_INT (val); + SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), + PBM_SETPOS, (WPARAM)XINT (val), 0); + return Qt; + } + return Qunbound; +} + /************************************************************************/ /* initialization */ @@ -2434,6 +2484,10 @@ INITIALIZE_DEVICE_IIFORMAT (mswindows, scrollbar); IIFORMAT_HAS_DEVMETHOD (mswindows, scrollbar, instantiate); + INITIALIZE_DEVICE_IIFORMAT (mswindows, progress); + IIFORMAT_HAS_DEVMETHOD (mswindows, progress, set_property); + IIFORMAT_HAS_DEVMETHOD (mswindows, progress, instantiate); + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (bmp, "bmp"); IIFORMAT_HAS_METHOD (bmp, validate); @@ -2474,6 +2528,7 @@ Fprovide (Qcombo); Fprovide (Qscrollbar); Fprovide (Qlabel); + Fprovide (Qprogress); } void Index: src/glyphs-widget.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/glyphs-widget.c,v retrieving revision 1.1.2.3 diff -u -u -r1.1.2.3 glyphs-widget.c --- src/glyphs-widget.c 1998/12/29 21:32:35 1.1.2.3 +++ src/glyphs-widget.c 1999/01/04 17:30:21 @@ -51,9 +51,11 @@ #endif DEFINE_IMAGE_INSTANTIATOR_FORMAT (label); Lisp_Object Qlabel; +DEFINE_IMAGE_INSTANTIATOR_FORMAT (progress); +Lisp_Object Qprogress; Lisp_Object Q_descriptor, Q_height, Q_width, Q_properties, Q_items; -Lisp_Object Q_image; +Lisp_Object Q_image, Q_text, Q_percent; #define WIDGET_BORDER_HEIGHT 2 #define WIDGET_BORDER_WIDTH 4 @@ -442,6 +444,8 @@ defkeyword (&Q_properties, ":properties"); defkeyword (&Q_items, ":items"); defkeyword (&Q_image, ":image"); + defkeyword (&Q_percent, ":percent"); + defkeyword (&Q_text, "text"); } void @@ -515,6 +519,14 @@ IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, check_valid_int); IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int); IIFORMAT_VALID_KEYWORD (scrollbar, Q_face, check_valid_face); + + /* progress guage */ + INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (progress, "progress"); + IIFORMAT_HAS_SHARED_METHOD (progress, validate, widget); + IIFORMAT_HAS_SHARED_METHOD (progress, possible_dest_types, widget); + IIFORMAT_HAS_SHARED_METHOD (progress, instantiate, widget); + VALID_WIDGET_KEYWORDS (progress); + VALID_GUI_KEYWORDS (progress); /* labels */ INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (label, "label"); Index: src/glyphs.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.h,v retrieving revision 1.18.2.7 diff -u -u -r1.18.2.7 glyphs.h --- src/glyphs.h 1998/12/29 21:32:35 1.18.2.7 +++ src/glyphs.h 1999/01/04 17:30:22 @@ -622,11 +622,11 @@ extern Lisp_Object Qxpm; extern Lisp_Object Q_data, Q_file, Q_color_symbols, Qconst_glyph_variable; -extern Lisp_Object Qxbm, Qedit, Qgroup, Qlabel, Qcombo, Qscrollbar; +extern Lisp_Object Qxbm, Qedit, Qgroup, Qlabel, Qcombo, Qscrollbar, Qprogress; extern Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y; extern Lisp_Object Q_foreground, Q_background, Q_face, Q_descriptor, Q_group; -extern Lisp_Object Q_width, Q_height, Q_pixel_width, Q_pixel_height; -extern Lisp_Object Q_items, Q_properties, Q_image, Qimage_conversion_error; +extern Lisp_Object Q_width, Q_height, Q_pixel_width, Q_pixel_height, Q_text; +extern Lisp_Object Q_items, Q_properties, Q_image, Q_percent, Qimage_conversion_error; extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph; extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph; extern Lisp_Object Vxemacs_logo; Index: src/s/cygwin32.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/s/cygwin32.h,v retrieving revision 1.14.2.4 diff -u -u -r1.14.2.4 cygwin32.h --- src/s/cygwin32.h 1998/12/29 21:32:36 1.14.2.4 +++ src/s/cygwin32.h 1999/01/04 17:30:22 @@ -105,6 +105,8 @@ #endif #endif +#define PBS_SMOOTH 0x01 + #ifdef HAVE_MS_WINDOWS #define HAVE_NTGUI #define HAVE_FACES Index: tests/glyph-test.el =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/tests/Attic/glyph-test.el,v retrieving revision 1.1.2.2 diff -u -u -r1.1.2.2 glyph-test.el --- tests/glyph-test.el 1998/12/29 21:32:37 1.1.2.2 +++ tests/glyph-test.el 1999/01/04 17:30:22 @@ -25,6 +25,18 @@ :face modeline-mousable :descriptor "ok" :callback foo :selected t]))) +;; progress guage +(set-extent-begin-glyph + (make-extent (point) (point)) + (setq pgauge (make-glyph + [progress :width 10 :height 2 + :descriptor "ok"]))) +;; progress the progress ... +(let ((x 0)) + (while (<= x 100) + (set-image-instance-property (glyph-image-instance pgauge) :percent x) + (setq x (+ x 5)) + (sit-for 0.1))) (set-extent-begin-glyph (make-extent (point) (point))