Commit Graph

82 Commits

Author SHA1 Message Date
Thilo Graf
6134115c63 gui/widget: add class CHourGlass
Provides an hourglass/snake-loader function to visualize running processes.
A template xcf-file for Gimp 2.10 is appended. Feel free to edit.
2021-10-08 23:10:30 +02:00
Thilo Graf
c9efac0665 hintbox: try to fix logic for enable/disable timeout bar.
Timeout bar could not be switched off, is now disabled for CHint
TODO: find a better solution to vizualize timeout for CHint.
      It looks not so good on the top of the hintbox, especially
      with round corners or frameless window.
2021-10-04 17:16:38 +02:00
Thilo Graf
b7e837d82b hintbox: expand ShowHintS() with slot parameter
This allows to execute one ore more methods inside the ShowHintS() method.
This should simplify calls of CHint messages with or without hide delays
In the simplest or most cases, only one code line is necessary for this,
see examples inside test_menu.cpp or here:

Single methode:
old:
CHintBox *hintBox new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT));
hintBox->paint();
g_Plugins->loadPlugins();
sleep(1);
hintBox->.hide();
delete hintbox;

new:
ShowHintS(LOCALE_SERVICEMENU_GETPLUGINS_HINT, 1, true, sigc::mem_fun(g_Plugins, &CPlugins::loadPlugins));

Multiple methods:
old:
	CHint *hint = new CHint("Restart Tuner");
	hint->paint();
	g_Zapit->setStandby(true);
	sleep(2);
	g_Zapit->setStandby(false);
	sleep(2);
	g_Zapit->Rezap();
	delete hint;

new:
	std::vector <hint_message_data_t> hints;
	hints.push_back({sigc::bind(sigc::mem_fun(g_Zapit, &CZapitClient::setStandby), true),"Stopping tuner...", NONEXISTANT_LOCALE, 2, true});
	hints.push_back({sigc::bind(sigc::mem_fun(g_Zapit, &CZapitClient::setStandby), false), "Start tuner...", NONEXISTANT_LOCALE, 2, true});
	hints.push_back({sigc::hide_return(sigc::mem_fun(g_Zapit, &CZapitClient::Rezap)), "Rezap...", NONEXISTANT_LOCALE, 2, true});
	ShowHintS(hints);

slots can be used with sigc::bind, sigc::hide_return (or what ever) too.
sample slot:
sigc::slot<void> sl = sigc::bind(sigc::mem_fun(this, &ClassName::method), parameter);

Note: Usage of namespace sigc are doing to simplify the lines,
      but this is a matter of discretion.

TODO: - timeoutbar should visualize a kind of busy mode.
      - implemetations
2021-10-03 11:50:48 +02:00
svenhoefer
4afe44f906 - hintbox: fix hardcoded keys
Signed-off-by: Thilo Graf <dbt@novatux.de>
2021-03-16 08:00:41 +01:00
Thilo Graf
c88a6ff7b3 cc: rework color handling for select and focus status 2020-12-07 20:33:52 +01:00
Thilo Graf
230cbf741b hintbox: assign missing item name for timeout bar 2020-02-15 22:41:50 +01:00
Thilo Graf
3f121c868e hintbox: fix enable/disable timeout bar
enable_timeout_bar was not considered within exec().
Each try to disable timeout bar (eg. with enableTimeOutBar())
was without effect.
2020-02-13 18:40:34 +01:00
Jacek Jendrzej
296d7b4a53 hintbox: supplement to fix getMaxWidth, hintbox have shadow default ON and shadow is added to width in cc_item (dx+sw). This break RestoreScreen 2020-02-04 13:01:11 +01:00
Jacek Jendrzej
41c841aa79 hintbox: fix getMaxWidth 2020-02-03 15:59:23 +01:00
Jacek Jendrzej
c133d89069 supplement to 1e76f6ef44, progresspar clean is after 'add possibility for more control of timeout bar' broken 2020-01-24 20:19:06 +01:00
Jacek Jendrzej
fee92f0ab4 hintbox: fix destructor, supplement to 1e76f6ef44 2020-01-22 23:41:47 +01:00
Thilo Graf
1e76f6ef44 hintbox: add possibility for more control of timeout bar
So we can enable/disable directly with setTimeOut() method.
Usefully to disable timeout bar if not required.
2020-01-22 21:25:53 +01:00
Thilo Graf
54582340c6 hintbox: fix init order of setValue() and paint() 2020-01-05 21:17:59 +01:00
Thilo Graf
b1f9c3c7f3 cc_timer/cc_frm_clock: allow use of milisecond intervals
Should be easier and more flexible to handle without nano parameter,
some reworkes in other classes and thread handlings are required.
2020-01-05 21:17:59 +01:00
Thilo Graf
52e8737d2d themes: add option to enable frames for message and hint boxes 2019-10-27 16:24:47 +01:00
Thilo Graf
9234f67d98 CHintBox/CMsgBox: use frames as default for better highlighting 2019-10-27 16:24:47 +01:00
Thilo Graf
cb40dcb9ea widget/hintbox.cpp/h: use disconnect instead check for OnTimer
diconnect ensures handle of current slot.
2018-12-31 11:46:55 +01:00
Thilo Graf
6237bfe07c hintbox/msgbox: add more specific thread names
For better tracing while debugging.
2018-12-31 11:46:55 +01:00
Thilo Graf
d4fb223045 src/gui/widget/hintbox.cpp: connect OnTimer slot only if is still empty
Prevent multiple connections to slot. Only to be sure.
2018-12-09 17:29:44 +01:00
GetAway
72badc7202 hintbox.cpp: fix scale of box width 2018-10-05 23:11:27 +02:00
Thilo Graf
882a4654a8 widget/hintbox.cpp: add explicit init of var picon
Had some issues while compile with gcc 7.x.
Exact data type was expected.
2017-12-04 20:16:12 +01:00
svenhoefer
99cc7f850a - rcinput: simplify calcTimeoutEnd() calls; 0 is "off" by default now 2017-09-29 10:34:23 +02:00
Thilo Graf
87b53a8597 CHintBox: fix possible unintended cut of text
Last line size was not considered.
2017-09-17 21:50:59 +02:00
Thilo Graf
c0cc7ef192 Merge branch 'master' into pu/fb-setmode 2017-05-21 18:09:22 +02:00
Thilo Graf
8c29b8e68f CHintBox: use less colors time scale mode for visual timeout
Otherwise probably in this context to much colored with default settings.
2017-05-21 18:00:21 +02:00
Thilo Graf
e48cc87b6f CHintBox: fix position in case of missing text
Without text, position was not complete calculated.
Only default position was used.
2017-05-17 20:11:28 +02:00
Thilo Graf
820ea4db3b CHintBox: fix passed width parameter 2017-02-26 21:29:53 +01:00
Stefan Seyfried
5188f721c4 set useful thread names for all spawned threads 2017-02-12 22:55:36 +01:00
Stefan Seyfried
58c6dbf469 cc: reduce impact of cc_draw header from 161 to 4 files 2017-02-12 22:50:44 +01:00
Stefan Seyfried
2303d94300 replace fontrenderer.h include with forward declaration
in order to flatten the build dependency tree further, include
fontrenderer.h directly where needed, in header files a forward
declaration is enough
2017-02-07 17:23:42 +01:00
Stefan Seyfried
5f93b57d84 hintbox: restore proper handling of up/down keys
When no scrollbar is present, just pass through up/down keys instead
of only canceling the hintbox. This restores the behaviour before
commit dde298b1b7.
Prominent examle is the "channel not available" popup which prevented
further channel switching until canceled.
2017-01-29 21:27:45 +01:00
Thilo Graf
1d8de839d5 CHintBox: add possibility to left hintbox with RC_up and RC_down
RC_up and RC_down are used for text scroll, but most message texts
are small and no scroll mode is required. In case of large texts
it should falling back to scroll mode.
2017-01-11 11:32:32 +01:00
Thilo Graf
c60accaeae CHintBox: add overloaded version of setMsgText() with locale parameter 2017-01-05 22:53:47 +01:00
Thilo Graf
b714998065 CHintBox: small cosmetics for initial positions
This should have no effect, because calculation of position and dimensions
is mostly dependency from message text. So this is only formality.
2016-12-22 10:01:53 +01:00
Thilo Graf
bd75701fc3 CHintBox: fix timeout comparsion
default timeout was not defined
2016-12-12 21:37:17 +01:00
svenhoefer
0dc0789de8 - rename BUTTON_TOP to BUTTON_UP; it isn't a top-button 2016-12-07 15:37:03 +01:00
Thilo Graf
644063d2c8 Messages: move window to top of screen
User request.
2016-11-22 11:01:30 +01:00
Thilo Graf
e46d65fb92 CHintBox: fix missing shadow for popups
Must be enabled with enum, bool has no effect.
2016-11-22 10:44:50 +01:00
Thilo Graf
8b97f72ed1 Messages: try to fix API message handling
Passed timeout for messeages an popup's fired by yWeb API was not really
ok.
For popups now we have a setting with default value of 6 seconds timeout
Popups fired with ShowHint() use this as default. Value of 0 and -1
are ignored.
Messages fired with ShowMsg() should be fixed and interpret
value 0 or -1 as no timeout and will remain on the screen.
2016-11-22 10:32:10 +01:00
Thilo Graf
4988df1dd9 Messages: add option to change size of message text
Include default size and localized setup.

TODO: localize for nederlands and slovak, current english only.
2016-11-20 01:08:14 +01:00
Thilo Graf
27905b9acf CHintBox: update ascII scheme 2016-11-12 14:51:18 +01:00
Thilo Graf
075917e32d CHintBox: remove center text mode on used picon 2016-11-11 23:10:39 +01:00
Thilo Graf
7f5a576795 CHintBox: try to fix truncated chars
Last chars were truncated. Indent and titel text were not considered.
2016-11-11 21:42:07 +01:00
Thilo Graf
0952efaba4 CHintBox: optimize dynamic window width bahavior on different line sizes
Width calculation is now depends on largest line of text.
2016-11-10 11:19:09 +01:00
Thilo Graf
e3f51f2c91 CHintBox/CMsgBox: rework text handling and dynamic size behavior 2016-11-10 11:18:56 +01:00
Thilo Graf
4bdd5e11a9 CHintBox: add member to get maximal required width 2016-11-10 11:15:43 +01:00
Thilo Graf
a80b861cb5 CHintBox: move showTimeOutBar() to protected, add params to enableTimeOutBar()
Explicit call of disableTimeOutBar() after exec() is required to ensure
we have no timebar opened objects. I'm not shure, but otherwise crashs
could be possible.

showTimeOutBar() is required for OnTimer(). It doesn't need any
parameter.
2016-10-25 08:53:23 +02:00
Thilo Graf
a5ce26dfd9 CHintBox: try to optimize height and width of message window 2016-10-24 10:31:28 +02:00
Thilo Graf
6580c5a54a CHintBox: ensure remove timeout bar from screen if hintbox object is closed
Timeout bar is not embedded like other cc items in  this form, therefor is
is better to kill this object explicit from screen otherwise it is possible
we hab artefacts after closing of hintbox window.
2016-10-24 10:31:28 +02:00
Thilo Graf
2952dcc124 CHintBox: fix text mode pass
Rquired in inherited classes
2016-10-24 10:31:28 +02:00