Reply To: Find dialog – a tiny annoyance

Product Compare Forums Multi-Edit Support Find dialog – a tiny annoyance Reply To: Find dialog – a tiny annoyance

#6573
deleyd
Participant

EDIT: Modification to change made 8/19/06 3:09pm
EDIT: 8/19/06 3:42pm Looks like I may modify this further…
EDIT: 8/19/06 4:01pm Modified again. Let’s see if I get it right this time.

I’ve come up with a change that will fix this.

1. In Multi-Edit\src folder make a copy of Dialog.s named DialogDAVID.s . (Or something. We’ll edit the copy and keep the original intact.)

2. Edit DialogDAVID.s
2a. In macro DlgBuild, around line 2802 for ME2006 (2805 for ME9.10), search for the code:
[code:6nzg1nei]if ( ctrlType == dlg_Text ) {
// Code to optionally show history 0
if ( Parse_Int( "/SHOWH0=", Menu_Item_Str( Dlg, C_Parm, 1 ) ) ) {
MStr = Global_Str( History_Str + "0" );
}
else {
MStr = "";
}
if ( Svl( MStr ) == 0 ) {
MStr = Menu_Item_Str( Dlg, C_Parm, 2 );
}
SetDlgItemText( mainDlg, Ctrl.Id, MStr );
}
[/code:6nzg1nei]
At the end of this block insert my DWD ADD lines so it looks like:
[code:6nzg1nei]if ( ctrlType == dlg_Text ) {
// Code to optionally show history 0
if ( Parse_Int( "/SHOWH0=", Menu_Item_Str( Dlg, C_Parm, 1 ) ) ) {
MStr = Global_Str( History_Str + "0" );
}
else {
MStr = "";
}
if ( Svl( MStr ) == 0 ) {
MStr = Menu_Item_Str( Dlg, C_Parm, 2 );
}
SetDlgItemText( mainDlg, Ctrl.Id, MStr );
//DWD ADD
if ( XPos( "/SHOWH0=", Menu_Item_Str( Dlg, C_Parm, 1 ), 1 ) )
{
if ( ( !Parse_Int( "/SHOWH0=", Menu_Item_Str( Dlg, C_Parm, 1 ) ) )
&& ( Global_Str( History_Str + "0" ) != "" ) )
{
SendDlgItemMessage( mainDlg, ctrl.Id, CB_SETCURSEL, 1, 0 );
}else{
SendDlgItemMessage( mainDlg, ctrl.Id, CB_SETCURSEL, 0, 0 );
}
}
//DWD END ADD
}
[/code:6nzg1nei]

Recompile and Rebuild Macro Library.

For help on recompiling see [url:6nzg1nei]http://www.multieditsoftware.com/forums/viewtopic.php?t=359[/url:6nzg1nei]
To rebuild macro library, exit Multi-Edit, then go to START -> ALL PROGRAMS -> MULTI-EDIT -> REBUILD MACRO LIBRARY

For the search dialog the string under the cursor is always loaded at the top of the dropdown list. If "Pre-load search field with string under cursor" is checked this code will set the selected item to the top (0) item, otherwise it will set the selected item to the next (1) item, which is what you last searched for.

This post originally made this morning, modified this afternoon to fix so it only affects the Search for field in the Search Dialog, and no others. (Modified again 4:01pm to deal with when history 0 is empty.)