Skip to content

Commit

Permalink
Added configuration options to alter tooltip delay/show times
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgammon committed Sep 29, 2012
1 parent 74ed6c1 commit 555d6b4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions doc.h
Expand Up @@ -884,6 +884,10 @@ class CMUSHclientDoc : public CDocument
// version 4.81
unsigned short m_bAutoWrapInput; // Match input wrap to output?

// version 4.82
unsigned int m_iToolTipVisibleTime; // Time tooltip stays visible (milliseconds)
unsigned int m_iToolTipStartTime; // Time before tooltip appears (milliseconds)

// end of stuff saved to disk **************************************************************

// stuff from pre version 11, read from disk but not saved
Expand Down
9 changes: 6 additions & 3 deletions mushview.cpp
Expand Up @@ -1445,6 +1445,9 @@ previousLineHPtime.QuadPart = 0;

void CMUSHView::OnInitialUpdate()
{
CMUSHclientDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

CView::OnInitialUpdate();

CSize sizeTotal;
Expand All @@ -1459,9 +1462,9 @@ void CMUSHView::OnInitialUpdate()
if (m_ToolTip.Create(this, TTS_ALWAYSTIP | TTS_NOPREFIX | 0x40) && m_ToolTip.AddTool(this))
{
m_ToolTip.SendMessage(TTM_SETMAXTIPWIDTH, 0, SHRT_MAX);
m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, 5000);
m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, 400);
m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_RESHOW, 400);
m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, pDoc->m_iToolTipVisibleTime - 1); // zero will be default (-1)
m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, pDoc->m_iToolTipStartTime - 1); // zero will be default (-1)
m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_RESHOW, -1);

// add icon and title to tooltip
// TTI_NONE = 0 - no icon
Expand Down
2 changes: 2 additions & 0 deletions plugins/Config_Option_Changer.xml
Expand Up @@ -80,6 +80,8 @@ numeric_options = {
default_timer_send_to = { desc = 'New timers: Default send-to location', min = 0, max = 14 },
default_trigger_send_to = { desc = 'New triggers: Default send-to location', min = 0, max = 14 },
default_trigger_sequence = { desc = 'New triggers: Default sequence', min = 0, max = 10000 },
tool_tip_start_time = { desc = 'Tool tips: time before show, in milliseconds', min = 0, max = 120000 },
tool_tip_visible_time = { desc = 'Tool tips: time visible, in milliseconds', min = 0, max = 120000 },
} -- end numeric_options
-- colour options they can change
Expand Down
2 changes: 2 additions & 0 deletions scriptingoptions.cpp
Expand Up @@ -185,6 +185,8 @@ tConfigurationNumericOption OptionsTable [] = {
{"timestamp_input_back_colour", RGB (0, 0, 0), O(m_OutputLinePreambleInputBackColour), 0, 0xFFFFFF, OPT_RGB_COLOUR | OPT_UPDATE_VIEWS},
{"timestamp_notes_back_colour", RGB (0, 0, 0), O(m_OutputLinePreambleNotesBackColour), 0, 0xFFFFFF, OPT_RGB_COLOUR | OPT_UPDATE_VIEWS},
{"timestamp_output_back_colour", RGB (0, 0, 0), O(m_OutputLinePreambleOutputBackColour),0, 0xFFFFFF, OPT_RGB_COLOUR | OPT_UPDATE_VIEWS},
{"tool_tip_visible_time", 5000, O(m_iToolTipVisibleTime), 0, 120000},
{"tool_tip_start_time", 400, O(m_iToolTipStartTime), 0, 120000},
{"translate_backslash_sequences", false, O(m_bTranslateBackslashSequences)},
{"translate_german", false, O(m_bTranslateGerman)},
{"treeview_triggers", true, O(m_bTreeviewTriggers)},
Expand Down

0 comments on commit 555d6b4

Please sign in to comment.