Skip to content

Commit cbdce1b

Browse files
committed
Changes to tool tip start and visible time now take effect immediately
1 parent 04f9185 commit cbdce1b

File tree

2 files changed

+51
-18
lines changed

2 files changed

+51
-18
lines changed

doc.h

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -362,22 +362,24 @@ enum {
362362
DBG_ALL, // a whole lot of useless stuff
363363
};
364364

365-
#define OPT_CUSTOM_COLOUR 0x000001 // colour number (add 1 to colour to save, subtract 1 to load)
366-
#define OPT_RGB_COLOUR 0x000002 // colour is RGB colour
367-
#define OPT_DOUBLE 0x000004 // option is a double
368-
#define OPT_UPDATE_VIEWS 0x000100 // if changed, update all views
369-
#define OPT_UPDATE_INPUT_FONT 0x000200 // if changed, update input font
370-
#define OPT_UPDATE_OUTPUT_FONT 0x000400 // if changed, update output font
371-
#define OPT_FIX_OUTPUT_BUFFER 0x000800 // if changed, rework output buffer size
372-
#define OPT_FIX_WRAP_COLUMN 0x001000 // if changed, wrap column has changed
373-
#define OPT_FIX_SPEEDWALK_DELAY 0x002000 // if changed, speedwalk delay has changed
374-
#define OPT_USE_MXP 0x004000 // if changed, use_mxp has changed
375-
#define OPT_PLUGIN_CANNOT_READ 0x100000 // plugin may not read its value
376-
#define OPT_PLUGIN_CANNOT_WRITE 0x200000 // plugin may not write its value
377-
#define OPT_PLUGIN_CANNOT_RW 0x300000 // plugin may not read or write its value
378-
#define OPT_CANNOT_WRITE 0x400000 // cannot be changed by any script
379-
#define OPT_SERVER_CAN_WRITE 0x800000 // CAN be changed by <recommend_option> tag
380-
#define OPT_FIX_INPUT_WRAP 0x1000000 // Added for input wrapping.
365+
#define OPT_CUSTOM_COLOUR 0x000001 // colour number (add 1 to colour to save, subtract 1 to load)
366+
#define OPT_RGB_COLOUR 0x000002 // colour is RGB colour
367+
#define OPT_DOUBLE 0x000004 // option is a double
368+
#define OPT_UPDATE_VIEWS 0x000100 // if changed, update all views
369+
#define OPT_UPDATE_INPUT_FONT 0x000200 // if changed, update input font
370+
#define OPT_UPDATE_OUTPUT_FONT 0x000400 // if changed, update output font
371+
#define OPT_FIX_OUTPUT_BUFFER 0x000800 // if changed, rework output buffer size
372+
#define OPT_FIX_WRAP_COLUMN 0x001000 // if changed, wrap column has changed
373+
#define OPT_FIX_SPEEDWALK_DELAY 0x002000 // if changed, speedwalk delay has changed
374+
#define OPT_USE_MXP 0x004000 // if changed, use_mxp has changed
375+
#define OPT_PLUGIN_CANNOT_READ 0x100000 // plugin may not read its value
376+
#define OPT_PLUGIN_CANNOT_WRITE 0x200000 // plugin may not write its value
377+
#define OPT_PLUGIN_CANNOT_RW 0x300000 // plugin may not read or write its value
378+
#define OPT_CANNOT_WRITE 0x400000 // cannot be changed by any script
379+
#define OPT_SERVER_CAN_WRITE 0x800000 // CAN be changed by <recommend_option> tag
380+
#define OPT_FIX_INPUT_WRAP 0x1000000 // Added for input wrapping.
381+
#define OPT_FIX_TOOLTIP_VISIBLE 0x2000000 // Added for tooltip delay changing.
382+
#define OPT_FIX_TOOLTIP_START 0x4000000 // Added for tooltip delay changing.
381383

382384
// for debug.options and MXP <option> tag
383385
typedef struct

scriptingoptions.cpp

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "MUSHclient.h"
55

66
#include "doc.h"
7+
#include "MUSHview.h"
78
#include "scripting\errors.h"
89

910
#define NL "\r\n"
@@ -185,8 +186,8 @@ tConfigurationNumericOption OptionsTable [] = {
185186
{"timestamp_input_back_colour", RGB (0, 0, 0), O(m_OutputLinePreambleInputBackColour), 0, 0xFFFFFF, OPT_RGB_COLOUR | OPT_UPDATE_VIEWS},
186187
{"timestamp_notes_back_colour", RGB (0, 0, 0), O(m_OutputLinePreambleNotesBackColour), 0, 0xFFFFFF, OPT_RGB_COLOUR | OPT_UPDATE_VIEWS},
187188
{"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},
189+
{"tool_tip_visible_time", 5000, O(m_iToolTipVisibleTime), 0, 120000, OPT_FIX_TOOLTIP_VISIBLE},
190+
{"tool_tip_start_time", 400, O(m_iToolTipStartTime), 0, 120000, OPT_FIX_TOOLTIP_START},
190191
{"translate_backslash_sequences", false, O(m_bTranslateBackslashSequences)},
191192
{"translate_german", false, O(m_bTranslateGerman)},
192193
{"treeview_triggers", true, O(m_bTreeviewTriggers)},
@@ -551,6 +552,36 @@ long iResult = SetBaseOptionItem (iItem,
551552
if (OptionsTable [iItem].iFlags & OPT_FIX_SPEEDWALK_DELAY)
552553
SetSpeedWalkDelay ((short) Value);
553554

555+
POSITION pos;
556+
557+
if (OptionsTable [iItem].iFlags & OPT_FIX_TOOLTIP_VISIBLE)
558+
{
559+
for(pos=GetFirstViewPosition();pos!=NULL;)
560+
{
561+
CView* pView = GetNextView(pos);
562+
if (pView->IsKindOf(RUNTIME_CLASS(CMUSHView)))
563+
{
564+
CMUSHView* pmyView = (CMUSHView*)pView;
565+
if (pmyView->m_ToolTip.m_hWnd)
566+
pmyView->m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, Value - 1); // zero will be default (-1)
567+
} // end if
568+
} // end for
569+
} // end of OPT_FIX_TOOLTIP_VISIBLE
570+
571+
if (OptionsTable [iItem].iFlags & OPT_FIX_TOOLTIP_START)
572+
{
573+
for(pos=GetFirstViewPosition();pos!=NULL;)
574+
{
575+
CView* pView = GetNextView(pos);
576+
if (pView->IsKindOf(RUNTIME_CLASS(CMUSHView)))
577+
{
578+
CMUSHView* pmyView = (CMUSHView*)pView;
579+
if (pmyView->m_ToolTip.m_hWnd)
580+
pmyView->m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, Value - 1); // zero will be default (-1)
581+
} // end if
582+
} // end for
583+
} // end of OPT_FIX_TOOLTIP_VISIBLE
584+
554585
if (OptionsTable [iItem].iFlags & OPT_USE_MXP)
555586
{
556587
if (m_iUseMXP == eNoMXP && m_bMXP)

0 commit comments

Comments
 (0)