home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / smart21b.zip / SAMPLES / WIN31OS2 / UDMDSAMP.DCT < prev   
Text File  |  1995-03-02  |  6KB  |  137 lines

  1. .Table   =Test Win 3.1 Override
  2. .Version =1.2
  3. .Date    =03-02-95
  4.  
  5. .Keyword =999 000 999 $$PRE_PROCESS
  6. .SComment=Preprocess Command set
  7. .Command = SmGetListPath( LISTPATH )
  8.          = $GVARS = LISTPATH "\VARS1.DAT"
  9.          = SmPromptDlg( "Enter filename for loading process variables:",
  10.          =            $GVARS, OPTION, $GVARS, ~Ok | ~Abort )
  11.          = if OPTION = "Abort" then terminate
  12.          = SmLoadVars( $GVARS )
  13.          = if $GHAB = "" then
  14.          =            $GHAB = "hab"
  15.          = SmPromptDlg( "Enter application HAB variable name:",
  16.          =            $GHAB, OPTION, $GHAB, ~Ok | ~Abort )
  17.          = if OPTION = "Abort" then terminate
  18.  
  19. .Keyword =999 000 999 $$POST_PROCESS
  20. .SComment=Postprocess Command set
  21. .Command = SmSaveVars($GVARS, GLOBAL | STATIC )
  22.  
  23. .Keyword =010 010 130 HANDLE
  24. .SComment=Replace HANDLE with user option
  25. .LComment=Replace HANDLE with user option
  26. .Template=$SPARAM3
  27. .Command =SmSendToEditor( "$LFile($LLine:$LCol)R" )
  28.          =IF $Sparam3 = "" THEN
  29.          =     $Sparam3 = "HWND"
  30.          =IF $SDat3 = "" THEN
  31.          =     DO
  32.          =        SmGetSmartPath( PATH )
  33.          =        $SDat3 = PATH "\samples\win31os2\handle.dat"
  34.          =     END
  35.          =SmListDlg("Select Template to be used for handle migration",
  36.          =        $Sparam3, OPTION, $Sparam3, $SDat3)
  37.          =IF OPTION = "ABORT" then terminate
  38.          =SmMigrateKeyword( $T1 )
  39.  
  40. .Keyword =010 010 130 SetParent
  41. .SComment=Replace with WinSetParent and WinSetOwner
  42. .LComment=Replace with WinSetParent to change the parent and relative
  43.          =position of the window.  If setting the new parent to the
  44.          =desktop then use WinSetOwner to set the owner to NULL,
  45.          =otherwise set the owner to the new parent window.  Depending
  46.          =upon desired behavior it may be necessary to use
  47.          =WinSetWindowPos to reposition the window in the new parent's
  48.          =window.  Use WinQueryWindow with QW_PARENT to determine the
  49.          =current parent.
  50. .Sample  =Windows:
  51.          =  HWND hWndPrevParent = SetParent (hWnd, hWndParent);
  52.          =OS/2:
  53.          =  HWND hWndPrevParent = WinQueryWindow (hWnd, QW_PARENT);
  54.          =  WinSetParent (hWnd, hWndParent, TRUE);
  55.          =  if ((hWndParent != HWND_DESKTOP) &&
  56.          =      (hWndParent != HWND_OBJECT))
  57.          =    WinSetOwner (hWnd, hWndParent);
  58.          =  else
  59.          =    WinSetOwner (hWnd, (HWND)0);
  60. .Prototyp=HWND APIENTRY WinQueryWindow (HWND hwnd, LONG lCode);
  61.          =BOOL APIENTRY WinSetParent (HWND hwnd, HWND hwndNewParent,
  62.          =  BOOL fRedraw);
  63.          =BOOL APIENTRY WinSetOwner (HWND hwnd, HWND hwndNewOwner);
  64. .Template=$P2 = WinQueryWindow ($P1, QW_PARENT);
  65.          =WinSetParent ($P1, $P2, TRUE);
  66.          =if (($P2 != HWND_DESKTOP) &&
  67.          =   ($P2 != HWND_OBJECT))
  68.          =      WinSetOwner ($P1, $P2);
  69.          =   else
  70.          =      WinSetOwner ($P1, (HWND)0);
  71. .Command =/* Replace source code */
  72.          =IF $KIND = "TRUE" THEN
  73.          =   DO
  74.          =      SmSendToEditor( "$LFILE($LLINE:$LCOL)R" )
  75.          =      DISPLAY = "Check removal and replacement for keyword: " $KEY
  76.          =      SmDisplayDlg( DISPLAY, OPTION, ~Yes | ~No | ~Abort )
  77.          =      IF OPTION = "Abort" THEN
  78.          =         DO
  79.          =            TERMINATE
  80.          =         END
  81.          =      IF OPTION = "Yes" THEN
  82.          =         DO
  83.          =            SmRemove(LINE)
  84.          =            SmOutputLine( $T1 )
  85.          =            SmOutputLine( $T2 )
  86.          =            SmOutputLine( $T3 )
  87.          =            SmOutputLine( $T4 )
  88.          =            SmOutputLine( $T5 )
  89.          =            SmOutputLine( $T6 )
  90.          =            SmOutputLine( $T7 )
  91.          =            SmNoComment( ALL )
  92.          =            NOTE = "Source line removed and code replaced for:" $KEY
  93.          =            SmOutputNote( NOTE )
  94.          =         END
  95.          =   END
  96.          =ELSE
  97.          =   DO
  98.          =      string = "*** Unable to migrate : " $KEY
  99.          =      SmOutputNote( string )
  100.          =      SmOutputNote("*** Multi-line migration is embedded.")
  101.          =      SmNoMigrate( )
  102.          =   END
  103.  
  104.  
  105. .Keyword =010 030 280 DeleteMenu
  106. .SComment=Replace with WinSendMsg and MM_DELETEITEM
  107. .LComment=Replace with WinSendMsg to send the MM_DELETEITEM message to
  108.          =the menu containing the item to delete.  If MF_BYPOSITION is
  109.          =used then the identifier of the menu item must first be
  110.          =retrieved by sending the MM_ITEMIDFROMPOSITION message to
  111.          =the menu.  Note that all menu items, including popup menu
  112.          =items must have an identifier assigned.
  113. .Sample  =Windows:
  114.          =  DeleteMenu (hMenu, 2, MF_BYPOSITION);
  115.          =OS/2:
  116.          =  SHORT sID = (SHORT)WinSendMsg (hMenu,
  117.          =            MM_ITEMIDFROMPOSITION, MPFROMSHORT (2), MPVOID);
  118.          =  WinSendMsg (hMenu, MM_DELETEITEM, MPFROM2SHORT(sID,FALSE),
  119.          =    MPVOID);
  120. .Prototyp=BOOL APIENTRY WinSendMsg (HWND hwnd, ULONG ulMsgID,
  121.          =  MPARAM mParam1, MPARAM mParam2);
  122. .Template=SHORT sID = (SHORT)WinSendMsg ( $P1, MM_ITEMIDFROMPOSITION, MPFROMSHORT (2), MPVOID)
  123.          =  WinSendMsg ( $P1, MM_DELETEITEM, MPFROM2SHORT(sID,FALSE), PVOID);
  124. .Command =if $KIND = "TRUE" then
  125.          =   do
  126.          =      SmMigrateKeyword( $T1 )
  127.          =      SmOutputLine( $T2 )
  128.          =   end
  129.          =else
  130.          =   do
  131.          =      SmNoMigrate()
  132.          =      DISPLAY = "** No Migration. Embedded Keyword: " $KEY
  133.          =      SmOutputNote( DISPLAY )
  134.          =   end
  135. .Refer   =WinSendMsg
  136. .Refer   =MM_DELETEITEM
  137.