Skip to content

Commit 555d6b4

Browse files
committed
Added configuration options to alter tooltip delay/show times
1 parent 74ed6c1 commit 555d6b4

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

doc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,10 @@ class CMUSHclientDoc : public CDocument
884884
// version 4.81
885885
unsigned short m_bAutoWrapInput; // Match input wrap to output?
886886

887+
// version 4.82
888+
unsigned int m_iToolTipVisibleTime; // Time tooltip stays visible (milliseconds)
889+
unsigned int m_iToolTipStartTime; // Time before tooltip appears (milliseconds)
890+
887891
// end of stuff saved to disk **************************************************************
888892

889893
// stuff from pre version 11, read from disk but not saved

mushview.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,9 @@ previousLineHPtime.QuadPart = 0;
14451445

14461446
void CMUSHView::OnInitialUpdate()
14471447
{
1448+
CMUSHclientDoc* pDoc = GetDocument();
1449+
ASSERT_VALID(pDoc);
1450+
14481451
CView::OnInitialUpdate();
14491452

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

14661469
// add icon and title to tooltip
14671470
// TTI_NONE = 0 - no icon

plugins/Config_Option_Changer.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ numeric_options = {
8080
default_timer_send_to = { desc = 'New timers: Default send-to location', min = 0, max = 14 },
8181
default_trigger_send_to = { desc = 'New triggers: Default send-to location', min = 0, max = 14 },
8282
default_trigger_sequence = { desc = 'New triggers: Default sequence', min = 0, max = 10000 },
83+
tool_tip_start_time = { desc = 'Tool tips: time before show, in milliseconds', min = 0, max = 120000 },
84+
tool_tip_visible_time = { desc = 'Tool tips: time visible, in milliseconds', min = 0, max = 120000 },
8385
} -- end numeric_options
8486
8587
-- colour options they can change

scriptingoptions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ tConfigurationNumericOption OptionsTable [] = {
185185
{"timestamp_input_back_colour", RGB (0, 0, 0), O(m_OutputLinePreambleInputBackColour), 0, 0xFFFFFF, OPT_RGB_COLOUR | OPT_UPDATE_VIEWS},
186186
{"timestamp_notes_back_colour", RGB (0, 0, 0), O(m_OutputLinePreambleNotesBackColour), 0, 0xFFFFFF, OPT_RGB_COLOUR | OPT_UPDATE_VIEWS},
187187
{"timestamp_output_back_colour", RGB (0, 0, 0), O(m_OutputLinePreambleOutputBackColour),0, 0xFFFFFF, OPT_RGB_COLOUR | OPT_UPDATE_VIEWS},
188+
{"tool_tip_visible_time", 5000, O(m_iToolTipVisibleTime), 0, 120000},
189+
{"tool_tip_start_time", 400, O(m_iToolTipStartTime), 0, 120000},
188190
{"translate_backslash_sequences", false, O(m_bTranslateBackslashSequences)},
189191
{"translate_german", false, O(m_bTranslateGerman)},
190192
{"treeview_triggers", true, O(m_bTreeviewTriggers)},

0 commit comments

Comments
 (0)