General information
Category:
Menus & Menu designer
Hi Mark,
Here is very simple example how you can do this automaticaly.
**************************************************
*-- Class: pjhConvertMNU (project_hook.vcx)
*-- ParentClass: projecthook
*-- BaseClass: projecthook
*-- Zeitstempel: 06/21/99 12:55:06 PM
*
DEFINE CLASS pjhconvertmnu AS projecthook
Height = 22
Width = 23
Name = "pjhconvertmnu"
*-- saves the filename of all modified menues
DIMENSION iaopenedmenues[1]
PROCEDURE QueryModifyFile
LPARAMETERS oFile, cClassName
LOCAL lcFileName, lnCount
lcFileName = oFile.Name && Name of the file which is opened now
*
* check if the file is a menu and if it is not registered yet
*
IF UPPER(JUSTEXT(lcFileName)) = "MNX" AND ASCAN(this.iaOpenedMenues, lcFileName) = 0
lnCount = ALEN(this.iaOpenedMenues)
IF NOT (lnCount = 1 AND VARTYPE(this.iaOpenedMenues[1]) = "L")
DIMENSION this.iaOpenedMenues[lnCount + 1]
lnCount = lnCount + 1
ENDIF
this.iaOpenedMenues[lnCount] = lcFileName
ENDIF
ENDPROC
PROCEDURE Destroy
IF ALEN(this.iaOpenedMenues) >= 1 AND NOT VARTYPE(this.iaOpenedMenues[1]) = "L"
LOCAL lnI
FOR lnI = 1 TO ALEN(this.iaOpenedMenues)
USE (this.iaOpenedMenues[lnI]) ALIAS tmpMenu EXCLUSIVE
=AFIELDS(laFileStructure)
IF laFileStructure[22, 1] = "LOCATION" AND ;
laFileStructure[22, 3] = 2
*
* we have a menu in VFP 6 fileformat, so we modify this menu
*
WAIT CLEAR
WAIT WINDOW "Menu " + this.iaOpenedMenues[lnI] + " is converted to VFP 5!" NOWAIT
alter table tmpMenu alter column location N(1)
ENDIF
USE IN tmpMenu
ENDFOR
WAIT CLEAR
WAIT WINDOW "Updating of all menues is complete!" NOWAIT
ENDIF
ENDPROC
ENDDEFINE
*
*-- EndDefine: pjhsetdefaults
**************************************************
Regards
Franz
>How would I do that?
>
>
>>Hi Mark,
>>
>>>Thanks, but I was trying to deal with the PM problem. Oh well. I'll just have to modify delivered code.
>>>
>>
>>I have an other idea. What do you think about writing a project-hook, which makes the necessary change to the file structure, after you have opened and modified your menu in VFP 6.
>>
>>e.g.:
>>yourmenu.mnx (VFP 5 file-format) --> you can open it in VFP 5 and VFP 6
>>in VFP 5: you do not have to do anything
>>in VFP 6: after opening and modifying the menu, VFP 6 changes the structure.
>> After closing the menu, your project hook undoes the structure
>> changes
>>
>>Can you follow my ideas?
>>
>>Regards
>>
>> Franz
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only