With FF3.60 came the update to MLG. Deploying the change has for the most part been painless except for this line:
MLG_FormatColNumber HWND_ENTERPRICE_MLG1, 3, 5.2, %MLG_JUST_CENTER, -1, %MLG_NOLOCK
If I don't use the above formatting line, I can edit text in the cell. If I do use the line, the cell is locked. I downloaded & installed the latest MLG demo and installed the updated INC and DLL files.
What am I missing?
For set LOCK switch Try with:
MLG_FormatColNumber HWND_ENTERPRICE_MLG1, 3, 5.2,%MLG_JUST_CENTER,0, %MLG_LOCK
For set UNLOCK switch Try with:
MLG_FormatColNumber HWND_ENTERPRICE_MLG1, 3, 5.2,%MLG_JUST_CENTER,0, %MLG_NOLOCK
This is working fine for me.
Israel
Getting more interesting as we go. Apparently, empty cells don't get locked; only cells where I put text, like so:
MLG_PUT HWND_ENTERPRICE_MLG1, CurrRow, 4, Format$(gQuoteDetail(xLoop).MoldSetup(yLoop),"#.00"), 0
Figured out the problem. With the previous version I was using (1.15), when you TAB'd from one cell to another containing text, it automatically went into edit mode. With the new version, you need to double click with a mouse to get it to activate edit mode.
Now combing the help file for the appropriate flag.
Added:
Confirmed that this may be a new behavior in ver 2. I loaded the MLGDEMO program that came with the download, and added a line to pre-populate a formatted number field. With that, the field requires a double click in order to edit the data. This is different than how ver 1.15 behaved. I'll shoot a message to MLG support.
Snippet of the change I tested:
FUNCTION ShowOneGrid(hDlg AS LONG) AS LONG
MLG_Init
DIALOG NEW 0, "One Grid Example",,, 520, 370, %WS_SYSMENU OR %WS_THICKFRAME TO hDlg
'Switches
'e3 means tell MLG to auto append a row if needed providing something is in the cell
'r50 calls for 50 rows total
'c8 calls for 8 columns
'b3 means block selecting of rows, columns, and the entire grid is activated
'm1 active the right click menu with the following comma delimited menu items
CONTROL ADD "MYLITTLEGRID", hDlg, %IDC_MLGGRID1, "e3/r50/c8/b3/m1First,Second,Third", 4, 4, 510, 348, %MLG_STYLE
CONTROL HANDLE hDlg, %IDC_MLGGRID1 TO hGrid1
CONTROL ADD LISTBOX, hDlg, %IDC_MLGLIST1, , 4, 175, 250, 150,%WS_VSCROLL OR %LBS_NOTIFY ,%WS_EX_CLIENTEDGE
CONTROL HANDLE hDlg, %IDC_MLGLIST1 TO hList1
MLG_FormatColCheck hGrid1,1
MLG_FormatColCombo hGrid1,2,"1st Choice Ed,2nd Choice Ed ,3rd Choice Ed" 'Editable
MLG_FormatColCombo hGrid1,3,"1st Choice,2nd Choice,3rd Choice",1 'Static
MLG_FormatColDate hGrid1,4,%MMDDYYYY 'MM/DD/YYYY date format
MLG_FormatColNumber hGrid1,5,8.2,%MLG_JUST_RIGHT 'max 8 integer digits and max 2 decimal digits
MLG_FormatColEdit hGrid1,6,5,%MLG_UCASE 'Set max length to 5 characters and upper case everything
MLG_FormatColEdit hGrid1,7,%MLG_NULL,%MLG_NULL,%MLG_NULL,%RED,%MLG_LOCK
MLG_FormatColTitles hGrid1,"Check,ComboEdit,ComboStatic,Date MM/DD/YYYY,Number 8.2,Upper Case 5,Locked,Default"
SendMessage hGrid1, %MLG_SETCOLWIDTH, 4, 130
'---- test ---
MLG_PUT hGrid1,1,5,"12345.67",0
'--- end test
MLG_PUT hGrid1,1,7,"LOCKED",0
DIALOG SHOW MODAL hDlg CALL ShowOneGridProc
END FUNCTION