diff options
author | fvogel <fvogelnew1@free.fr> | 2016-08-18 19:05:41 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-08-18 19:05:41 (GMT) |
commit | ee16a52044d53a25664ecc7f02b042e3fb638baf (patch) | |
tree | 01838a76667e3e4f6101e8014c848e00b2e8fdc9 | |
parent | 0fbc2c33a10a40e46c9247049d602901b522c674 (diff) | |
download | tk-ee16a52044d53a25664ecc7f02b042e3fb638baf.zip tk-ee16a52044d53a25664ecc7f02b042e3fb638baf.tar.gz tk-ee16a52044d53a25664ecc7f02b042e3fb638baf.tar.bz2 |
Implementation of TIP #442 by René Zaumseil - Display text in progressbars
-rw-r--r-- | generic/ttk/ttkProgress.c | 27 | ||||
-rw-r--r-- | library/ttk/vistaTheme.tcl | 1 |
2 files changed, 27 insertions, 1 deletions
diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index eed90ec..bd0b814 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -30,6 +30,12 @@ typedef struct { Tcl_Obj *maximumObj; Tcl_Obj *valueObj; Tcl_Obj *phaseObj; + Tcl_Obj *textObj; + Tcl_Obj *fontObj; + Tcl_Obj *foregroundObj; + Tcl_Obj *anchorObj; + Tcl_Obj *justifyObj; + Tcl_Obj *wrapLengthObj; int mode; Ttk_TraceHandle *variableTrace; /* Trace handle for -variable option */ @@ -68,6 +74,24 @@ static Tk_OptionSpec ProgressbarOptionSpecs[] = {TK_OPTION_INT, "-phase", "phase", "Phase", "0", Tk_Offset(Progressbar,progress.phaseObj), -1, 0, 0, 0 }, + {TK_OPTION_STRING, "-text", "text", "Text", "", + Tk_Offset(Progressbar,progress.textObj), -1, + 0,0,GEOMETRY_CHANGED }, + {TK_OPTION_FONT, "-font", "font", "Font", + DEFAULT_FONT, Tk_Offset(Progressbar,progress.fontObj), -1, + TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, + {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", + "black", Tk_Offset(Progressbar,progress.foregroundObj), -1, + TK_OPTION_NULL_OK,0,0 }, + {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", + "w", Tk_Offset(Progressbar,progress.anchorObj), -1, + TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED}, + {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", + "left", Tk_Offset(Progressbar,progress.justifyObj), -1, + TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, + {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", + "0", Tk_Offset(Progressbar, progress.wrapLengthObj), -1, + TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED}, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) @@ -522,7 +546,8 @@ TTK_END_LAYOUT TTK_BEGIN_LAYOUT(HorizontalProgressbarLayout) TTK_GROUP("Horizontal.Progressbar.trough", TTK_FILL_BOTH, - TTK_NODE("Horizontal.Progressbar.pbar", TTK_PACK_LEFT|TTK_FILL_Y)) + TTK_NODE("Horizontal.Progressbar.pbar", TTK_PACK_LEFT|TTK_FILL_Y) + TTK_NODE("Horizontal.Progressbar.text", TTK_PACK_LEFT)) TTK_END_LAYOUT /* diff --git a/library/ttk/vistaTheme.tcl b/library/ttk/vistaTheme.tcl index 1ec824a..c284a52 100644 --- a/library/ttk/vistaTheme.tcl +++ b/library/ttk/vistaTheme.tcl @@ -182,6 +182,7 @@ namespace eval ttk::theme::vista { ttk::style layout Horizontal.TProgressbar { Horizontal.Progressbar.trough -sticky nswe -children { Horizontal.Progressbar.pbar -side left -sticky ns + Horizontal.Progressbar.text -sticky nesw } } ttk::style element create Vertical.Progressbar.pbar vsapi \ |