Gupta.narod.ru - примеры программирования на Gupta Team Developer 2005 (GTD, CTD, TOM, Quest, SQLTalk, Report Builder, SQLWindows, SQLBase, Oracle, Web Developer, Team Object Manager)

Найти: на
Скачать пример в архиве SalMisc
Вернуться на страницу архива примеров

.head 0 +  Application Description: Centura SQLWindows/32 Standard Application Template
.head 1 -  Outline Version - 4.0.27
.head 1 +  Design-time Settings
.data VIEWINFO
0000: 6F00000001000000 FFFF01000D004347 5458566965775374 6174650400010000
0020: 0000000000EE0000 002C000000020000 0003000000FFFFFF FFFFFFFFFFFCFFFF
0040: FFE9FFFFFFFFFFFF FF000000007C0200 004D010000010000 0001000000010000
0060: 000F4170706C6963 6174696F6E497465 6D00000000
.enddata
.head 2 -  Outline Window State: Normal
.head 2 +  Outline Window Location and Size
.data VIEWINFO
0000: 6600040003002D00 0000000000000000 0000B71E5D0E0500 1D00FFFF4D61696E
0020: 0000000000000000 0000000000000000 0000003B00010000 00000000000000E9
0040: 1E800A00008600FF FF496E7465726E61 6C2046756E637469 6F6E730000000000
0060: 0000000000000000 0000000000003200 0100000000000000 0000E91E800A0000
0080: DF00FFFF56617269 61626C6573000000 0000000000000000 0000000000000000
00A0: 3000010000000000 00000000F51E100D 0000F400FFFF436C 6173736573000000
00C0: 0000000000000000 0000000000000000
.enddata
.data VIEWSIZE
0000: D000
.enddata
.head 3 -  Left: -0.013"
.head 3 -  Top:    0.0"
.head 3 -  Width:  8.013"
.head 3 -  Height: 4.969"
.head 2 +  Options Box Location
.data VIEWINFO
0000: D4180909B80B1A00
.enddata
.data VIEWSIZE
0000: 0800
.enddata
.head 3 -  Visible? No
.head 3 -  Left: 4.15"
.head 3 -  Top:    1.885"
.head 3 -  Width:  3.8"
.head 3 -  Height: 2.073"
.head 2 +  Class Editor Location
.head 3 -  Visible? No
.head 3 -  Left: 0.575"
.head 3 -  Top:    0.094"
.head 3 -  Width:  5.063"
.head 3 -  Height: 2.719"
.head 2 +  Tool Palette Location
.head 3 -  Visible? No
.head 3 -  Left: 6.388"
.head 3 -  Top:    0.729"
.head 2 -  Fully Qualified External References? Yes
.head 2 -  Reject Multiple Window Instances? No
.head 2 -  Enable Runtime Checks Of External References? Yes
.head 2 -  Use Release 4.0 Scope Rules? No
.head 1 -  Libraries
.head 1 +  Global Declarations
.head 2 +  Window Defaults
.head 3 +  Tool Bar
.head 4 -  Display Style? Etched
.head 4 -  Font Name: MS Sans Serif
.head 4 -  Font Size: 8
.head 4 -  Font Enhancement: System Default
.head 4 -  Text Color: System Default
.head 4 -  Background Color: System Default
.head 3 +  Form Window
.head 4 -  Display Style? Etched
.head 4 -  Font Name: MS Sans Serif
.head 4 -  Font Size: 8
.head 4 -  Font Enhancement: System Default
.head 4 -  Text Color: System Default
.head 4 -  Background Color: System Default
.head 3 +  Dialog Box
.head 4 -  Display Style? Etched
.head 4 -  Font Name: MS Sans Serif
.head 4 -  Font Size: 8
.head 4 -  Font Enhancement: System Default
.head 4 -  Text Color: System Default
.head 4 -  Background Color: System Default
.head 3 +  Top Level Table Window
.head 4 -  Font Name: MS Sans Serif
.head 4 -  Font Size: 8
.head 4 -  Font Enhancement: System Default
.head 4 -  Text Color: System Default
.head 4 -  Background Color: System Default
.head 3 +  Data Field
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Multiline Field
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Spin Field
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Background Text
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Pushbutton
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 3 +  Radio Button
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Check Box
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Option Button
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 3 +  Group Box
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Child Table Window
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  List Box
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Combo Box
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Line
.head 4 -  Line Color: Use Parent
.head 3 +  Frame
.head 4 -  Border Color: Use Parent
.head 4 -  Background Color: 3D Face Color
.head 3 +  Picture
.head 4 -  Border Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 2 +  Formats
.head 3 -  Number: 0'%'
.head 3 -  Number: #0
.head 3 -  Number: ###000
.head 3 -  Number: ###000;'($'###000')'
.head 3 -  Date/Time: hh:mm:ss AMPM
.head 3 -  Date/Time: M/d/yy
.head 3 -  Date/Time: MM-dd-yy
.head 3 -  Date/Time: dd-MMM-yyyy
.head 3 -  Date/Time: MMM d, yyyy
.head 3 -  Date/Time: MMM d, yyyy hh:mm AMPM
.head 3 -  Date/Time: MMMM d, yyyy hh:mm AMPM
.head 2 -  External Functions
.head 2 +  Constants
.data CCDATA
0000: 3000000000000000 0000000000000000 00000000
.enddata
.data CCSIZE
0000: 1400
.enddata
.head 3 -  System
.head 3 +  User
.head 4 -  ! SalMessageOut constants
.head 4 -  Number: MSG_File 		 = 4	!LogFile
.head 4 -  Number: MSG_Status	 = 2	!Statustext
.head 4 -  Number: MSG_Box		 = 1	!Messagebox
.head 4 -  ! SalShellExecute contstants
.head 4 -  Number: SHELL_Print = 1
.head 4 -  Number: SHELL_Edit = 2
.head 4 -  Number: SHELL_Open = 3
.head 4 -  Number: SHELL_Find = 4
.head 4 -  Number: SHELL_Explore = 5
.head 4 -  Number: SHELL_MailTo = 6
.head 2 -  Resources
.head 2 -  Variables
.head 2 +  Internal Functions
.head 3 -  ! ! Misc
.head 3 +  ! Function: SalGetPrevChild
.head 4 -  Description: 
.head 4 +  Returns 
.head 5 -  Window Handle: 
.head 4 +  Parameters 
.head 5 -  Window Handle: hWndChild
.head 5 -  Number: nTypeMask
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables 
.head 4 +  Local variables 
.head 5 -  Window Handle: hWndPrev
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: lnType
.head 4 +  Actions 
.head 5 +  Loop 
.head 6 -  Set hWndPrev = GetWindow( hWndChild, GW_HWNDPREV  )
.head 6 -  Set lnType = SalGetType( hWndPrev )
.head 6 -  ! if the type is included in the typemask
.head 6 +  If (nTypeMask & lnType) = lnType
.head 7 -  Break 
.head 6 +  If hWndChild = hWndPrev
.head 7 -  Set hWndPrev = hWndNULL
.head 7 -  Break 
.head 5 -  Return hWndPrev
.head 3 +  Function: SalEditCopyLongString
.head 4 -  Description: author: Rainer Ebert
date:    	1.0
version:	09.12.2003

desc:
Copies a string to the clipboard (without the 64 size limit)
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  String: p_sText
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: hAlloc
.head 5 -  Number: nhText
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nLengthOfText
.head 5 -  Number: nSizeOfText
.head 4 +  Actions
.head 5 -  ! Open clipboard
.head 5 -  Call SalWaitCursor( TRUE )
.head 5 +  If OpenClipboard( hWndForm )
.head 6 -  !
.head 6 -  ! Empty clipboard
.head 6 -  Call EmptyClipboard( )
.head 6 -  !
.head 6 -  ! Allocate a buffer
.head 6 -  Set nLengthOfText = SalStrLength( p_sText )
.head 6 -  Set nSizeOfText = nLengthOfText + 1
.head 6 -  Set hAlloc = GlobalAlloc( GMEM_MOVEABLE, nSizeOfText )
.head 6 +  If hAlloc = NUMBER_Null
.head 7 -  Call CloseClipboard()
.head 7 -  Call SalWaitCursor( FALSE )
.head 7 -  Return FALSE
.head 6 -  !
.head 6 -  ! Copy string to the buffer
.head 6 -  Set nhText = GlobalLock( hAlloc )
.head 6 -  Call memcpy( nhText, p_sText, nLengthOfText )
.head 6 -  !
.head 6 -  ! Release buffer
.head 6 -  Call GlobalUnlock( hAlloc )
.head 6 -  !
.head 6 -  ! Copy buffer to clipboard
.head 6 -  Call SetClipboardData( CF_TEXT, hAlloc )
.head 6 -  !
.head 6 -  ! Close clipboard
.head 6 -  Call CloseClipboard()
.head 6 -  !
.head 6 -  Call SalWaitCursor( FALSE )
.head 6 -  Return TRUE
.head 5 +  Else
.head 6 -  Call SalWaitCursor( FALSE )
.head 6 -  Return FALSE
.head 3 +  Function: SalRessourceLoad
.head 4 -  Description: author: 	tl (inspired by Ch. Schubert (teatalk) )
date:	2002
version:	1.00

desc:
Loads a Centura ressource into a string buffer

example:
Set strBuffer = SalRessourceLoad('bmpTest')
Call SalPicSetString(pic1, PIC_FormatBitmap, strBuffer)
.head 4 +  Returns
.head 5 -  Long String:
.head 4 +  Parameters
.head 5 -  String: fpsRessourceName
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Long String: strBuffer
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: lvnDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  String: lvsDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Date/Time: lvdDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Window Handle: lvwDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  ! load ressource (this stupid tick is necessary, because only ressources, not strins or IDґs are allowed to load )
.head 5 +  If fpsRessourceName
.head 6 -  Call SalCompileAndEvaluate ( ' SalResLoad (' || fpsRessourceName || ',
strBuffer) ', lvnDummy, lvnDummy, lvnDummy, lvsDummy, lvdDummy, lvwDummy,
TRUE, SalContextCurrent( ) )
.head 5 -  Return strBuffer
.head 3 +  Function: SalRessourceToTempFile
.head 4 -  Description: author: 	Ch. Schubert (teatalk) modified by tl
date:	2002
version:	1.00

desc:
Writes a CTD ressource to a temp-file.
This is needed when you have e.g. a AVi-File of .WAV file included as ressource
and want ot play it. The animcontrol only lets you play a AVi-file.
Donґt forget to delete the file with VisFileDelete(...) , when the animcontrol is destroyed.

example:
Ressource:
   Bitmap: aviFileCopy
      FileName: C:\Test\filecopy.avi

  Set sPath = SalRessourceToTempFile('aviFileCopy')
  Call Animcontrol.Play( sPath )
.head 4 +  Returns
.head 5 -  String:
.head 4 +  Parameters
.head 5 -  String: psRessource
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Long String: sBuffer
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  String: sTempFileName
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  File Handle: hFile
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  ! Load the ressource in a buffer
.head 5 -  Set sBuffer = SalRessourceLoad(psRessource)
.head 5 +  If not sBuffer
.head 6 -  Return STRING_Null
.head 5 -  ! write to a temp file
.head 5 -  Call SalStrSetBufferLength ( sTempFileName, 260 )
.head 5 -  Call GetTempFileNameA ( ".", "TMP", 0, sTempFileName )
.head 5 +  If SalFileOpen ( hFile, sTempFileName, OF_Create | OF_Binary | OF_Write )
.head 6 -  Call SalFileWrite ( hFile, sBuffer, SalStrGetBufferLength ( sBuffer ) )
.head 6 -  Call SalFileClose ( hFile )
.head 6 -  ! return the filename (included path)
.head 6 -  Return sTempFileName
.head 5 -  Return STRING_Null
.head 3 +  Function: SalSetEditable
.head 4 -  Description: author: 	tl
date:	2000
version:	1.00

OBSOLETE !!!! willbe removed -> SalSetWindowEditable(...) is the new function
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWnd
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Boolean: pbEditable
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Call SalSendMsg( phWnd, EM_SETREADONLY, (not pbEditable), 0 )
.head 3 +  Function: SalIsWindowEditable
.head 4 -  Description: author: Martin Knopp
date:	???
version:	1.00

desc:
Checks whether a edit control is editable or not

example:
if SalIsWindowEditable( dfTest )
   ...
Else
   ...

See also:
SalSetWindowEditable
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  Window Handle: p_hWnd
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Return GetWindowLongA(p_hWnd,GWL_STYLE) & ES_READONLY != ES_READONLY
.head 3 +  Function: SalGetItemNameX
.head 4 -  Description: author: 	tl
date:	2000
version:	1.00

.head 4 +  Returns
.head 5 -  String:
.head 4 +  Parameters
.head 5 -  Window Handle: phWndItem
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  String: lsDummy
.head 4 +  Actions
.head 5 -  Call SalGetItemName (phWndItem, lsDummy)
.head 5 -  Return lsDummy
.head 3 +  Function: SalClearAllFields
.head 4 -  Description: author: 	tl
date:	2000
version:	1.00

desc:
Clears all child windows of the given types. When controls should not be cleared,
you must set the flag WF_NoClear (defined in vt libraries)


Parameter:
phWndForm:	Handle des Windows
pnType:		Windowtype ( TYPE_DataField, TYPE_TableColumn, .... )

example:

listbox: lb1
On SAM_Create
  Call VisWinSetFlags(hWndItem, WF_No_Clear )


Call SalClearAllFields(hWndFOrm, TYPE_Any )
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndForm
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnType
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Window Handle: lhWndChild
.head 4 +  Actions
.head 5 -  Set lhWndChild = SalGetFirstChild( phWndForm, pnType )
.head 5 +  While lhWndChild != hWndNULL
.head 6 -  ! Nur wenn kein NOCLEAR Flag gesetzt ist
.head 6 +  If not ( VisWinGetFlags (hWndForm) & WF_NoClear = WF_NoClear)
.head 7 -  Call SalClearField( lhWndChild )
.head 6 -  Set lhWndChild = SalGetNextChild( lhWndChild, pnType )
.head 3 +  Function: SalDisableAllWins
.head 4 -  Description: author: 	tl
date:	2000
version:	1.00

desc:
Enabled all childwindows

parameter:
phWndForm:	handle of the window
pnType:		Windowtype ( TYPE_DataField, TYPE_TableColumn, .... )

To exclude a childwindow, you can set a flag called WF_NoDisable
(like VisWinClearAllFields where you set WF_NoClear to exclude a childwindow from beeing cleared)


example:
ComboBox:
  On SAM_Create
	Call VisWinSetFlags(WF_NoDisable )


.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndForm
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnType
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Window Handle: lhWndChild
.head 4 +  Actions
.head 5 -  Set lhWndChild = SalGetFirstChild( phWndForm, pnType )
.head 5 +  While lhWndChild != hWndNULL
.head 6 +  If VisWinGetFlags(lhWndChild) != WF_NoDisable
.head 7 -  Call SalDisableWindow( lhWndChild )
.head 6 -  Set lhWndChild = SalGetNextChild( lhWndChild, pnType )
.head 3 +  Function: SalEnableAllWins
.head 4 -  Description: author: 	tl
date:	2000
version:	1.00

desc:
Enabled all childwindows

parameter:
phWndForm:	handle of the window
pnType:		Windowtype ( TYPE_DataField, TYPE_TableColumn, .... )

To exclude a childwindow, you can set a flag called WF_NoEnable
(like VisWinClearAllFields where you set WF_NoClear to exclude a childwindow from beeing cleared)


example:
ComboBox:
  On SAM_Create
	Call VisWinSetFlags(WF_NoEnable )


.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndForm
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnType
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Window Handle: lhWndChild
.head 4 +  Actions
.head 5 -  Set lhWndChild = SalGetFirstChild( phWndForm, pnType )
.head 5 +  While lhWndChild != hWndNULL
.head 6 +  If VisWinGetFlags(lhWndChild) != WF_NoEnable
.head 7 -  Call SalEnableWindow( lhWndChild )
.head 6 -  Set lhWndChild = SalGetNextChild( lhWndChild, pnType )
.head 3 +  Function: SalSetFieldSelect
.head 4 -  Description: author: 	Lubos (adapted by tl)
date:	??.??.2000
version:	1.00

desc:
Select a piece of text in a edit control
- To remove the current selection set pnStart = -1
- To select all text set pnStart = 0 and pnEnd = -1
- For Setting the caret to the end set pnStart = SalStrLength( MyControlName ) and pnEnd = SalStrLength( MyControlName )


example:
Call SalSetFieldSelect( ml1, 20, 40 )

.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndItem
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnStart
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnEnd
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Call SalPostMsg( phWndItem, EM_SETSEL, pnStart, pnEnd )
.head 5 -  Call SalPostMsg( phWndItem, EM_SCROLLCARET, 0, 0 )
.head 3 +  Function: SalGetFieldSelect
.head 4 -  Description: author: 	Lubos (adapted by tl)
date:	??.??.2000
version:	1.01 changed the length from 2000 to 100000
	1.00 function implemented

desc:
Gets the selected text in a edit control

example:
Set lsSelectedText =  SalGetFieldSelect( ml1, lnStart, lnEnd )
.head 4 +  Returns
.head 5 -  Long String:
.head 4 +  Parameters
.head 5 -  Window Handle: phWndItem
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: pnStart
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: pnEnd
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: lnSubString
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Long String: lsText
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Set lnSubString	= SalSendMsg( phWndItem, EM_GETSEL, 0, 0 )
.head 5 -  Set pnStart =  SalNumberLow( lnSubString )
.head 5 -  Set pnEnd =  SalNumberHigh ( lnSubString )
.head 5 -  Call SalGetWindowText(phWndItem, lsText, 100000 )
.head 5 -  Return SalStrMidX( lsText, pnStart, pnEnd -pnStart )
.head 3 +  Function: SalPlayWAV
.head 4 -  Description: author:
date:
version:

desc:
plays a WAV-File

example:
Call SalPlayWAV('test.wav')

To Stop:
Call SalPlayWAV('')
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  String: psName
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Call sndPlaySoundA( psName, SND_Async )
.head 3 +  Function: SalPlayWAVRessource
.head 4 -  Description: author: 	C. Schubert (teatalk) adapted by tl
date:
version:	1.00

desc:
plays a WAV-File from a StringBuffer

example:

Ressources
  MUSICTEST
     File Name: test.wav

Long String: strBuffer

    Set strBuffer = SalRessourceLoad('MUSICTEST')
    Call SalPlayWAVRessource(strBuffer)

To Stop:
Call SalPlayWAV('')
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Long String: pstrBuffer
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Call sndPlaySoundA( pstrBuffer, SND_Async | SND_MEMORY )
.head 3 +  Function: SalGetWindowScrollInfo
.head 4 -  Description: author:  taken from NG (C. Astor contribution).
date:
version:

desc:
Return the scrollinfo of a window (FormWindow, multiline, ... )

example:
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  Window Handle: hWnd
.data INHERITPROPS
0000: 0100
.enddata
.head 5 +  Number: nOrientation
.data INHERITPROPS
0000: 0100
.enddata
.head 6 -  ! SB_VERT
SB_HORZ
.head 5 -  Receive Number: nMin
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: nMax
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: nPage
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: nPos
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: nTrackPos
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: lnMin
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: lnMax
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: lnPage
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: lnPos
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: lnTrackPos
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: lnSize
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: lnFlags
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Set lnSize = 28
.head 5 -  Set lnFlags = SIF_ALL
.head 5 -  Return GetScrollInfo( hWnd, nOrientation, lnSize, lnFlags, nMin, nMax, nPage, nPos,
nTrackPos )
.head 3 +  Function: SalGetWindowTextFromStr
.head 4 -  Description: author:		WP Nijhof
date:		17.7.2002
version		1.00 function implemented

desc:
Works like SalGetWindowText(...), with the name of a item, specified in a string.

example:
Call SalGetWindowTextbyStr('df1',wsText,255)
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  String: psName
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive String: lsStr
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnLength
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: lvnDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  String: lvsDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Date/Time: lvdDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Window Handle: lvwDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Call SalCompileAndEvaluate ( ' SalGetWindowText(' || psName || ',lsStr,pnLength)', lvnDummy, lvnDummy, lvnDummy, lvsDummy, lvdDummy, lvwDummy, FALSE, SalContextCurrent(  ) )
.head 3 +  Function: SalGetWindowTextX
.head 4 -  Description: author: 	tl (Thomas Lauzi)
date:	2000
version:	1.00
.head 4 +  Returns
.head 5 -  String:
.head 4 +  Parameters
.head 5 -  Window Handle: phWndPWindow
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  String: lsText
.head 4 +  Actions
.head 5 -  Call SalGetWindowText (phWndPWindow, lsText, 1000000)
.head 5 -  Return lsText
.head 3 +  Function: SalGetWindowClientSize
.head 4 -  Description: author: 	tl (Thomas Lauzi)
date:	14.09.2003
version:	1.00

desc:
Returns a window's client size. (without toolbar,...) in form units

example:
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  Window Handle: hWnd
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: nLeft
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: nTop
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: nWidth
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: nHeight
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: nX1
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nY1
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nX2
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nY2
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Call GetClientRect(hWnd,nX1,nY1,nX2,nY2 )
.head 5 -  Set nLeft = SalPixelsToFormUnits(hWnd, nX1 ,FALSE )
.head 5 -  Set nTop =  SalPixelsToFormUnits(hWnd, nY1 ,TRUE )
.head 5 -  Set nWidth = SalPixelsToFormUnits(hWnd, nX2 - nX1 ,FALSE )
.head 5 -  Set nHeight =  SalPixelsToFormUnits(hWnd, nY2 - nY1 ,TRUE )
.head 3 +  Function: SalSetProfileInt
.head 4 -  Description: author: Andrew K.
date:
version:

desc:
Sets an integer value of an entry in the specified section of an initialization file or registry.

example:

.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  String: strSection
.head 5 -  String: strEntry
.head 5 -  Number: nValue
.head 5 -  String: strFileName
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Return SalSetProfileString(  strSection, strEntry, SalNumberToStrX( nValue, 0 ), strFileName )
.head 3 +  Function: SalSetWindowEditable
.head 4 -  Description: author: 	tl
date:	2000
version:	1.00

Sets a control editable / not editable

See also:
SalIsWindowEditable
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWnd
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Boolean: pbEditable
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Call SalSendMsg( phWnd, EM_SETREADONLY, (not pbEditable), 0 )
.head 3 +  Function: SalSetWindowLabelColor
.head 4 -  Description: author: 	tl
date:	2000
version:	1.00

Setzt Textfarbe eines Feldlabels
(Text muЯ sich in der Outline vor dem Feld befinden)

Parameter:
hWnd             des zu beschriftenden Feldes
Number          ColorIndex ( COLOR_IndexCellText, COLOR_IndexTransparent,
                                          COLOR_IndexWindow oder COLOR_IndexWindowText )
Number          Color (zB. COLOR_Black, COLOR_Blue oder COLOR_DarkGray)

Bsp:
Call SalSetWindowLabelColor(dfLabel, COLOR_IndexWindowText, COLOR_Black)
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWnd
.head 5 -  Number: pnColorIndex
.head 5 -  Number: pnColor
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Window Handle: lhLabel
.head 4 +  Actions
.head 5 -  Set lhLabel = GetWindow( phWnd, GW_HWNDPREV  )
.head 5 -  Call SalColorSet( lhLabel, pnColorIndex, pnColor )
.head 3 +  Function: SalSetWindowTextAtCaret
.head 4 -  Description: author: 	tl
date:  	17.07.2003
version 	1.1 - tl - 17.07.2003
	1.0 - tl - 07.10.2002

desc:
Inserts a string at the caret postion

example:
Call SalSetWindowTextAtCaret(mlTest,'sdsds')

.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndItem
.head 5 -  String: psStr
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Long String: lsText
.head 5 -  Number: lnStart
.head 5 -  Number: lnEnd
.head 4 +  Actions
.head 5 -  Call VisSendMsgString(phWndItem, EM_REPLACESEL, TRUE, psStr )
.head 3 +  Function: SalSetWindowScrollInfo
.head 4 -  Description: author:  taken from NG (C. Astor contribution).
date:
version:

desc:
Sets the scrollinfo of a window (FormWindow, multiline, ... )

example:
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  Window Handle: hWnd
.data INHERITPROPS
0000: 0100
.enddata
.head 5 +  Number: nOrientation
.data INHERITPROPS
0000: 0100
.enddata
.head 6 -  ! SB_VERT
SB_HORZ
.head 5 -  Number: nMin
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nMax
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nPage
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nPos
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nTrackPos
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Return SetScrollInfo( hWnd, nOrientation, 28, SIF_ALL, nMin, nMax, nPage, nPos,
nTrackPos,TRUE )
.head 3 +  Function: SalInvalidateChildren
.head 4 -  Description: author: 	tl
date:  	1.11.2002
version 	1.0

desc:
Invalidates all childwindows

example:
Call SalInvalidateChildren( hWndForm )
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndForm
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Window Handle: hWndChild
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Set hWndChild = SalGetFirstChild( phWndForm, TYPE_Any )
.head 5 +  While hWndChild != hWndNULL
.head 6 -  Call SalInvalidateWindow( hWndChild )
.head 6 -  Set hWndChild = SalGetNextChild( hWndChild, TYPE_Any )
.head 3 +  Function: SalScrollOnWheel
.head 4 -  Description: author:	Didier Tourneur (i think)
date:	???
version:	1.00

For scrolling by mouswheel. Replaces the old SalTblScrollOnWheel function
The function must be called On WM_MOUSEWHEEL.

parameter:
phWnd :      The window/ control you want to scroll

Ex:

Child Table: ctbl1
On WM_MOUSEWHEEL
	Call SalScrollOnWheel(hWndItem,wParam,lParam)

ListBox: lb
On WM_MOUSEWHEEL
	Call SalScrollOnWheel(hWndItem,wParam,lParam)

Form Window: frm1
On WM_MOUSEWHEEL
	Call SalScrollOnWheel(hWndItem,wParam,lParam)

.head 4 +  Returns
.head 5 -  Number:
.head 4 +  Parameters
.head 5 +  Window Handle: phWnd
.data INHERITPROPS
0000: 0100
.enddata
.head 6 -  ! The window/ control you want to scroll
.head 5 +  Number: wParam
.head 6 -  ! wParam of current On WM_MOUSEWHEEL
.head 5 +  Number: lParam
.head 6 -  ! lParam of current On WM_MOUSEWHEEL
.head 4 +  Static Variables
.head 5 -  Number: s_nDeltaAcc
.head 4 +  Local variables
.head 5 -  Number: nScrollUnits
.head 5 -  Number: nwParam
.head 5 -  Number: nKeys
.head 5 -  Number: nDelta
.head 4 +  Actions
.head 5 -  Set nKeys = SalNumberLow( wParam )
.head 5 -  Set nDelta = SalNumberHigh( wParam )
.head 5 +  If nDelta > 32767
.head 6 -  Set nDelta = nDelta - 65536
.head 5 -  Set s_nDeltaAcc = s_nDeltaAcc + nDelta
.head 5 -  Set nScrollUnits = SalNumberTruncate( s_nDeltaAcc / WHEEL_DELTA, 3, 0 )
.head 5 -  Set s_nDeltaAcc = SalNumberMod( s_nDeltaAcc, WHEEL_DELTA )
.head 5 +  If nScrollUnits < 0
.head 6 +  If nKeys & MK_CONTROL
.head 7 -  Set nwParam = SB_PageDown
.head 6 +  Else
.head 7 -  Set nwParam = SB_LineDown
.head 6 -  Set nScrollUnits = SalNumberAbs( nScrollUnits )
.head 5 +  Else
.head 6 +  If nKeys & MK_CONTROL
.head 7 -  Set nwParam = SB_PageUp
.head 6 +  Else
.head 7 -  Set nwParam = SB_LineUp
.head 5 +  While nScrollUnits
.head 6 -  Call SalSendMsg( phWnd, WM_VSCROLL, nwParam, 0 )
.head 6 -  Set nScrollUnits = nScrollUnits - 1
.head 5 -  Return nScrollUnits
.head 3 +  Function: SalGetScreenInfo
.head 4 -  Description: 
author: Aidas Kavaliauskas
date:     5.11.01
version: 1.00

desc:
Gets the resolution and color depth of an given device

example:
Call SalSysGetScreenInfo(hWndForm,pnX,pnY,pnColor)
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndDevice
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: pnResHorz
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: pnResVert
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: pnColor
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: hDC
.head 5 -  Number: lnBitsPerPixel
.head 4 +  Actions
.head 5 -  Set hDC = GetDC( phWndDevice )
.head 5 -  Set pnResHorz = GetDeviceCaps( hDC, HORZRES )
.head 5 -  Set pnResVert = GetDeviceCaps( hDC, VERTRES )
.head 5 -  Set lnBitsPerPixel = GetDeviceCaps( hDC, BITSPIXEL )
.head 5 -  Set pnColor = 1
.head 5 -  ! Calc the value of the bits per pixel
.head 5 +  While lnBitsPerPixel > 0
.head 6 -  Set pnColor = pnColor * 2
.head 6 -  Set lnBitsPerPixel = lnBitsPerPixel - 1
.head 5 -  Call ReleaseDC(phWndDevice,hDC)
.head 3 +  Function: SalTemplateToHandle
.head 4 -  Description: author: tl
date: 16.03.2004

desc:
Converts a template to a handle. works only Correct if you have only ONE instance of the object.

If lParam = SalTemplateToHandle( dfText )
  ...
.head 4 +  Returns
.head 5 -  Window Handle:
.head 4 +  Parameters
.head 5 -  Window Handle: hWnd
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Return hWnd
.head 3 +  Function: SalSetButtonChecked
.head 4 -  Description: author: 	tl
date:	???
version:	1.00

desc:
Sets the state of a radiobutton or checkbox.

See also:
SalIsButtonChecked
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  Window Handle: hWndField
.head 5 -  Boolean: bState
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Return ( SalSendMsg( hWndField, BM_SETCHECK, bState, 0 ) > 0 )
.head 3 +  Function: SalGetWindowIcon
.head 4 -  Description: author: 	tl
date:	????
version: 	1.01 improved handling for toolbar enabled
                      1.00
desc:
Returns the icon handle of corner of a window

example:

Set HICON = SalPicGetWindowIcon(hWndForm)
.head 4 +  Returns
.head 5 -  Number:
.head 4 +  Parameters
.head 5 -  Window Handle: phWndForm
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Window Handle: hWndToolBar
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Set hWndToolBar = SalGetFirstChild( phWndForm, TYPE_FormToolBar ) 
.head 5 -  !
.head 5 +  Select Case SalGetType( phWndForm )
.head 6 +  Case TYPE_MDIWindow
.head 7 +  If NOT SalIsWindowVisible(hWndToolBar) AND hWndToolBar != hWndNULL
.head 8 -  Set phWndForm = GetParent( phWndForm )
.head 7 -  Break
.head 6 +  Case TYPE_FormWindow
.head 7 +  If SalIsWindowVisible(hWndToolBar)
.head 8 -  Set phWndForm = GetParent( phWndForm )
.head 7 -  Break
.head 5 -  !
.head 5 -  Return SalSendMsg( phWndForm, WM_GETICON, ICON_SMALL, 0 )
.head 3 +  Function: SalSetWindowIcon
.head 4 -  Description: author: 	
date:	????
version: 	1.01 tl - improved handling for toolbar enabled
	1.00 Taken from sample by Charles Mc Louth

desc:
Sets the icon of a window

example:
Call SalSetWindowIcon(hWndForm, HICON )
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  Window Handle: phWndForm
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: HICON
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Window Handle: hWndToolBar
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Set hWndToolBar = SalGetFirstChild( phWndForm, TYPE_FormToolBar ) 
.head 5 -  !
.head 5 +  Select Case SalGetType( phWndForm )
.head 6 +  Case TYPE_MDIWindow
.head 7 +  If NOT SalIsWindowVisible(hWndToolBar) AND hWndToolBar != hWndNULL
.head 8 -  Set phWndForm = GetParent( phWndForm )
.head 7 -  Break
.head 6 +  Case TYPE_FormWindow
.head 7 +  If SalIsWindowVisible(hWndToolBar)
.head 8 -  Set phWndForm = GetParent( phWndForm )
.head 7 -  Break
.head 5 -  !
.head 5 -  Return SalSendMsg( phWndForm, WM_SETICON, ICON_SMALL, HICON )
.head 3 +  Function: SalShellExecute
.head 4 -  Description: author: tl
date: 13.04.2004
version: 1.00

desc:
Maps the ShellExecute function of the winAPI to Centura constants

parameter:
pnOperation                               SHELL_Print
                                                        SHELL_Edit
                                                        SHELL_Open
                                                        SHELL_Find
                                                        SHELL_Explore
                                                        SHELL_MailTo 

psName                                       Name o the target (to open, mailadress, URL,..)

psParam                                      Optional paramters

pnWindowState                         Window_Maximized
                                                         Window_Minimized
                                                         Window_Normal

example:
Call SalShellExecute( SHELL_MailTo,'tl@bdl.de','', Window_Normal )
Call SalShellExecute( SHELL_Open,'www.centurasoft.com','', Window_Normal )
Call SalShellExecute( SHELL_Open,'C:\\Temp\\Test.exe','', Window_Maximized )
.head 4 -  Returns
.head 4 +  Parameters
.head 5 +  Number: pnOperation
.head 6 -  ! SHELL_Print
 SHELL_Edit
 SHELL_Open
 SHELL_Find
 SHELL_Explore
 SHELL_MailTo 
.head 5 -  String: psName
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  String: psParam
.data INHERITPROPS
0000: 0100
.enddata
.head 5 +  Number: pnWindowState
.head 6 -  ! Window_Maximized
Window_Minimized
Window_Normal
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: lnWindowState
.head 5 -  String: lsOperation
.head 4 +  Actions
.head 5 -  !
.head 5 +  If psName = STRING_Null
.head 6 -  Return FALSE
.head 5 -  !
.head 5 +  Select Case pnWindowState
.head 6 +  Case Window_Minimized
.head 7 -  Set lnWindowState = SW_SHOWMINIMIZED
.head 7 -  Break
.head 6 +  Case Window_Normal
.head 7 -  Set lnWindowState = SW_SHOWNORMAL
.head 7 -  Break
.head 6 +  Case Window_Maximized
.head 7 -  Set lnWindowState = SW_SHOWMAXIMIZED
.head 7 -  Break
.head 5 -  !
.head 5 +  Select Case pnOperation
.head 6 +  Case SHELL_Print
.head 7 -  Set lsOperation = 'print'
.head 7 -  Break
.head 6 +  Case SHELL_Edit
.head 7 -  Set lsOperation = 'edit'
.head 7 -  Break
.head 6 +  Case SHELL_Open
.head 7 -  Set lsOperation = 'open'
.head 7 -  Break
.head 6 +  Case SHELL_Find
.head 7 -  Set lsOperation = 'find'
.head 7 -  Break
.head 6 +  Case SHELL_Explore
.head 7 -  Set lsOperation = 'explore'
.head 7 -  Break
.head 6 +  Case SHELL_MailTo
.head 7 -  Set lsOperation = 'open'
.head 7 +  If SalStrLeftX(SalStrLowerX(psName),7) != 'mailto:'
.head 8 -  Set psName = 'mailto:' || psName
.head 7 -  Break
.head 5 -  !
.head 5 -  Return ShellExecuteA( hWndNULL, lsOperation, psName, psParam, "", lnWindowState )
.head 3 -  ! ! ! Msg
.head 3 +  Function: SalMsgSendString
.head 4 -  Description: author: 	C. Astor /adapted by tl
date:	????
version: 	1.00

desc:
For sending strings to other applications
using WM_COPY_DATA(see also SalMsgReceiveString)

example:
Call SalMsgSendString(FindWindowA( STRING_Null, "Window 2" ), 'teststring' )

.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: hWndDest
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  String: sText
.head 4 +  Static Variables
.head 5 -  Number: nAddrString
.head 5 -  String: sBufferString
.head 4 +  Local variables
.head 5 -  String: sBuffer
.head 5 -  Number: nAddr
.head 4 +  Actions
.head 5 -  Call SalStrSetBufferLength( sBuffer, 12 )
.head 5 -  Call CStructPutLong( sBuffer, 0 , 0 )
.head 5 -  Call CStructPutLong( sBuffer, 4 , SalStrLength(sText)   )
.head 5 -  Call SalStrSetBufferLength( sBufferString, 255 )
.head 5 -  Call CStructPutString( sBufferString, 0, SalStrLength(sText)+ 1, sText )
.head 5 -  Set nAddrString = CStructAllocFarMem( 255 )
.head 5 -  Call CStructCopyToFarMem( nAddrString, sBufferString, SalStrLength(sText)+1)
.head 5 -  Call CStructPutLong( sBuffer, 8,  nAddrString )
.head 5 -  !
.head 5 -  Call VisSendMsgString( hWndDest, WM_COPYDATA, SalWindowHandleToNumber( hWndForm ), sBuffer )
.head 5 -  Call CStructFreeFarMem( nAddrString )
.head 3 +  Function: SalMsgReceiveString
.head 4 -  Description: author: 	C. Astor /adapted by tl
date:	????
version: 	1.00

desc:
Receives the strings on WM_COPY_DATA, sent by SalMsgSendString (..).

example:
On WM_COPY_DATA
   Set sText =  SalMsgReceiveString(wParam,lParam)
.head 4 +  Returns
.head 5 -  String:
.head 4 +  Parameters
.head 5 -  Number: pnwParam
.head 5 -  Number: pnlParam
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  String: sText
.head 5 -  String: sBuffer
.head 5 -  Number: nAddr
.head 5 -  Number: nAddrString
.head 5 -  Number: nStringLength
.head 4 +  Actions
.head 5 -  Call SalStrSetBufferLength( sBuffer, 12 )
.head 5 -  Call CStructCopyFromFarMem( pnlParam, sBuffer, 12 )
.head 5 -  Set nStringLength = CStructGetLong( sBuffer, 4 )
.head 5 -  Set nAddrString = CStructGetLong( sBuffer, 8 )
.head 5 -  Set sText = ""
.head 5 -  Call SalStrSetBufferLength( sText,  255 )
.head 5 -  Call CStructCopyFromFarMem( nAddrString, sText, nStringLength  )
.head 5 -  Return sText
.head 3 +  Function: SalSendAppMsg
.head 4 -  Description: author:	idea by Centura Pro backissue (modified by tl )
date:	???
version:	1.00

desc
Sends the specified message at the application level.

example:

Call SalSendAppMsg( SAM_AppExit,0,0)
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  Number: nMsg
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nMywParam
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nMylParam
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Return PostThreadMessageA( GetCurrentThreadId() , nMsg, nMywParam, nMylParam )
.head 3 -  ! ! Font
.head 3 +  Function: SalFontSetSize
.head 4 -  Description: author: 	tl
date:	24.01.2002
version:	V1.00

desc:
Sets the size of a window font

Parameter:



.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWnd
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nSize
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  String: sFontName
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nFontEnh
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: hFont
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Call SalFontGet( phWnd,sFontName, nDummy, nFontEnh )
.head 5 -  Call SalFontSet(phWnd,sFontName,nSize,nFontEnh )
.head 3 +  Function: SalFontGetSize
.head 4 -  Description: author: 	tl
date:	24.01.2002
version:	V1.00

desc:
Gets a windows font size

Parameter:



.head 4 +  Returns
.head 5 -  Number:
.head 4 +  Parameters
.head 5 -  Window Handle: phWnd
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  String: sFontName
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nFontEnh
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: hFont
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nSize
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Call SalFontGet( phWnd,sFontName, nSize, nFontEnh )
.head 5 -  Return nSize
.head 3 -  ! ! Wait cursor
.head 3 +  Function: SalWaitCursorAnimStart
.head 4 -  Description: author:	?? (iceteagroup ?, C.Astor ?)
date:	2002
version:	1.00

desc:
Shows an animated wait cursor.
The parametermust be an file of type *.ani

example:
Set lbAnim =  SalWaitCursorAnimStart('Test.ani')
...
if lbAnim
     Call SalWaitCursorAnimStop()
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  String: p_sAnimate
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  File Handle: fhAnimate
.head 5 -  Window Handle: hWndWait
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Window Handle: hWndCopyOfWait
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Window Handle: hWndAnimate
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Boolean: bAniExist
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  !
.head 5 -  ! Animated Cursor exist?
.head 5 +  If p_sAnimate != ""
.head 6 +  If SalFileOpen( fhAnimate, p_sAnimate, OF_Exist )
.head 7 -  Call SalFileClose( fhAnimate )
.head 7 -  Set bAniExist = TRUE
.head 5 -  !
.head 5 -  ! Start the system wait cursor
.head 5 -  Call SalWaitCursor( TRUE )
.head 5 -  !
.head 5 -  ! Get the handle of the system wait cursor
.head 5 -  Set hWndWait = GetCursor()
.head 5 -  Set hWndCopyOfWait = CopyIcon( hWndWait )
.head 5 -  !
.head 5 -  ! Stop the system wait cursor
.head 5 -  Call SalWaitCursor( FALSE )
.head 5 -  !
.head 5 -  ! Load the animated cursor
.head 5 +  If bAniExist and hWndWait != hWndNULL
.head 6 -  !
.head 6 -  Set hWndAnimate = LoadCursorFromFileA( p_sAnimate )
.head 6 -  !
.head 6 +  If hWndAnimate != hWndNULL
.head 7 -  !
.head 7 -  ! Replace the system wait cursor
.head 7 +  If not SetSystemCursor( hWndAnimate, SalStrToNumber( IDC_WAIT ) )
.head 8 -  Return FALSE
.head 7 -  !
.head 5 -  ! Show the new wait cursor
.head 5 -  Call SalWaitCursor( TRUE )
.head 5 -  Return TRUE
.head 3 +  Function: SalWaitCursorAnimStop
.head 4 -  Description: author:	?? (iceteagroup ?, C.Astor ?)
	I ( TL ) modified this function a little bit but it is not resetting
	the cursor correctly (Have i make it broken, if somebody finds the solution ??)
date:	2002
version:	1.00

desc:
Stops the animated wait cursor.

example:
Set lbAnim =  SalWaitCursorAnimStart('Test.ani')
...
if lbAnim
     Call SalWaitCursorAnimStop()
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 -  Parameters
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Window Handle: hWndCursor
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Call SalWaitCursor( FALSE )
.head 5 -  ! Set hWndCopyOfWait = GetCursor()
.head 5 +  If hWndCursor = hWndNULL
.head 6 -  Return FALSE
.head 5 -  !
.head 5 -  Set hWndCursor = SalNumberToWindowHandle( LoadCursorA( NUMBER_Null, IDC_WAIT ) )
.head 5 -  ! Replace the original wait cursor
.head 5 +  If Not SetSystemCursor( hWndCursor, SalStrToNumber( IDC_WAIT ) )
.head 6 -  ! then we have a problem, specially on NT
.head 6 -  Return FALSE
.head 5 -  Call SalWaitCursor( FALSE )
.head 5 -  Return TRUE
.head 3 +  Function: SalWaitCursorX
.head 4 -  Description: author:	tl
date:	2002
version:	1.00

desc:
Remembers the LAST curosor state, no stacking. So if the cursor is TRUE
and you call the function with TRUE and the with FALSE the
cursor will be true, because before he was TRUE. But the function can only
remeber the last state, so calling it fisrt with FALSE then several times with TRUE
and then with FALSE will not set the cursor FALSE, he will be TRUE

Is:	Input	Is:	Input:	Is:
FALSE	TRUE	TRUE	FALSE	FALSE
TRUE	TRUE	TRUE	FALSE	TRUE


example:
Set lbChanged =  SalWaitCursorX( TRUE )
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  Boolean: pbOn
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Static Variables
.head 5 -  Boolean: sbChanged
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Local variables
.head 4 +  Actions
.head 5 +  If pbOn
.head 6 -  Set sbChanged =  SalWaitCursor( pbOn )
.head 6 -  Return sbChanged
.head 5 +  Else
.head 6 -  Return SalWaitCursor( not sbChanged )
.head 3 +  Function: SalWaitCursorGetState
.head 4 -  Description: author:	John Babilon
date:	???
version:	1.00

desc:
Returns the state of the cursor (if wait cursor or not)

example:
If SalWaitCursorGetState() = TRUE
    ....

.head 4 -  Returns
.head 4 -  Parameters
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Boolean: bState
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Set bState = SalWaitCursor(FALSE)
.head 5 -  Call SalWaitCursor(bState)
.head 5 -  Return bState
.head 3 -  ! ! ! Statusbar
.head 3 +  Function: SalStatusGetHandle
.head 4 -  Description: author: 	Catalin
date:	??
version	 1.00       function implemented

version:	1.01        added parameter for parentwindow



desc:
Gives the handle of the statusbar

example:
Set hWndStatus = SalStatusGetHandle()
.head 4 +  Returns
.head 5 -  Window Handle:
.head 4 +  Parameters
.head 5 -  Window Handle: phWndParent
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 +  Select Case SalGetType( phWndParent )
.head 6 +  Case TYPE_MDIWindow
.head 7 -  Return GetDlgItem( phWndParent , 0x7ff1 )
.head 6 +  Case TYPE_FormWindow
.head 7 -  Return GetDlgItem( GetParent( phWndParent ), 0x7ff1 )
.head 3 -  ! ! ! Execute
.head 3 +  Function: SalExecFunction
.head 4 -  Description: author: 	fecher
date:	????
version: 	1.00

Ausfьhren der als String gespeicherten Funktion

ex:
Set sFunctionName = "DoSomething()"
Call SalExecFunction( sFunctionName )
...
Call SalExecFunction( "fGet_Id( )" )
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  String: psFunctionName
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: lvnError
.head 5 -  Number: lvnErrorPos
.head 5 -  Number: lvnReturn
.head 5 -  String: lvsReturn
.head 5 -  Date/Time: lvdtReturn
.head 5 -  Window Handle: lvhWndReturn
.head 5 -  String: lvsLookupFn
.head 4 +  Actions
.head 5 -  Call SalCompileAndEvaluate(psFunctionName,lvnError, lvnErrorPos,lvnReturn, lvsReturn, lvdtReturn, lvhWndReturn,TRUE,SalContextCurrent(  ) )
.head 5 -  ! wenn nicht gefunden, ьber Parent referenzieren
.head 5 +  If lvnError = 3112
.head 6 -  Call SalGetItemName( SalParentWindow( hWndItem ), lvsLookupFn )
.head 6 -  Set lvsLookupFn = lvsLookupFn || '.' || psFunctionName
.head 6 -  If SalCompileAndEvaluate(
lvsLookupFn,
lvnError, lvnErrorPos,
lvnReturn, lvsReturn, lvdtReturn, lvhWndReturn,
TRUE,
SalContextCurrent(  ) )
.head 2 -  Named Menus
.head 2 +  Class Definitions
.head 3 +  Multiline Field Class: mlAutoSize
.head 4 -  Data
.head 5 -  Maximum Data Length: Class Default
.head 5 -  String Type: Class Default
.head 5 -  Editable? No
.head 4 -  Display Settings
.head 5 -  Border? No
.head 5 -  Word Wrap? Yes
.head 5 -  Vertical Scroll? No
.head 5 -  Window Location and Size
.head 6 -  Left:
.head 6 -  Top:   
.head 6 -  Width:  1.0"
.head 6 -  Width Editable? Class Default
.head 6 -  Height: 0.667"
.head 6 -  Height Editable? Class Default
.head 5 -  Visible? Class Default
.head 5 -  Font Name: Class Default
.head 5 -  Font Size: Class Default
.head 5 -  Font Enhancement: Class Default
.head 5 -  Text Color: Class Default
.head 5 -  Background Color: 3D Face Color
.head 4 -  List in Tool Palette? Yes
.head 4 -  Property Template:
.head 4 -  Class DLL Name:
.head 4 -  Description: Multiline, dass seine GrцЯe automatisch dem Text anpasst.
Einfach von Klasse ableiten und Inhalt mit wfSetText() setzen.
.head 4 -  Derived From
.head 4 -  Class Variables
.head 4 -  Instance Variables
.head 4 +  Functions
.head 5 +  Function: wfSetText
.head 6 -  Description:
.head 6 +  Returns
.head 7 -  Boolean:
.head 6 +  Parameters
.head 7 -  String: p_sText
.head 6 -  Static Variables
.head 6 -  Local variables
.head 6 +  Actions
.head 7 +  If SalSetMaxDataLength( hWndItem, SalStrLength( p_sText ) )
.head 8 -  Set MyValue	= p_sText
.head 8 -  Return __cfSetWidth( )
.head 7 +  Else
.head 8 -  Return FALSE
.head 5 +  Function: __cfSetWidth
.head 6 -  Description:
.head 6 +  Returns
.head 7 -  Boolean:
.head 6 -  Parameters
.head 6 -  Static Variables
.head 6 +  Local variables
.head 7 -  Boolean: bOk
.head 7 -  Number: hDC
.head 7 -  Number: hGDIObj
.head 7 -  Number: nTextPixelWidth
.head 7 -  Number: nTextPixelHeight
.head 7 -  String: lsText
.head 7 -  String: lsMsg
.head 7 -  String: lsTabs[*]
.head 7 -  Number: lnMaxWidth
.head 7 -  Number: lnMaxHeight
.head 7 -  Number: lnIdx
.head 7 -  Number: lnLineBreaks
.head 7 -  Number: lnTabs
.head 6 +  Actions
.head 7 -  Set bOk	= SalFmtFieldToStr( hWndItem, lsMsg, TRUE )
.head 7 -  Set hDC	= GetDC( hWndItem )
.head 7 +  If hDC
.head 8 -  Set lnLineBreaks = 1
.head 8 -  Set hGDIObj = SelectObject( hDC, SalNumberLow( SalSendMsg( hWndItem, WM_GETFONT, 0, 0 ) ) )
.head 8 +  While SalStrScan(lsMsg, CRLF) >= 0
.head 9 -  Set lsText = SalStrSeperatebyChar(lsMsg, CRLF)
.head 9 -  Call GetTextExtentPoint32A( hDC, lsText, SalStrLength( lsText ), nTextPixelWidth, nTextPixelHeight )
.head 9 -  Set lnTabs = SalStrTokenize(lsText, '', '	', lsTabs) - 1
.head 9 +  If lnTabs > 0
.head 10 -  Set nTextPixelWidth = nTextPixelWidth + (lnTabs * 46)
.head 9 +  If lnMaxWidth < nTextPixelWidth
.head 10 -  Set lnMaxWidth = nTextPixelWidth
.head 9 +  If lnMaxHeight < nTextPixelHeight
.head 10 -  Set lnMaxHeight = nTextPixelHeight
.head 9 -  Set lnLineBreaks = lnLineBreaks + 1
.head 8 +  If lnLineBreaks = 1
.head 9 -  Call GetTextExtentPoint32A( hDC, MyValue, SalStrLength( MyValue ), lnMaxWidth, lnMaxHeight )
.head 9 -  Set lnTabs = SalStrTokenize(MyValue, '', '	', lsTabs) - 1
.head 9 +  If lnTabs > 0
.head 10 -  Set lnMaxWidth = lnMaxWidth + (lnTabs * 46)
.head 8 +  Else If lsMsg
.head 9 -  Call GetTextExtentPoint32A( hDC, lsMsg, SalStrLength( lsMsg ), nTextPixelWidth, nTextPixelHeight )
.head 9 -  Set lnTabs = SalStrTokenize(lsMsg, '', '	', lsTabs) - 1
.head 9 +  If lnTabs > 0
.head 10 -  Set nTextPixelWidth = nTextPixelWidth + (lnTabs * 46)
.head 9 +  If lnMaxWidth < nTextPixelWidth
.head 10 -  Set lnMaxWidth = nTextPixelWidth
.head 9 +  If lnMaxHeight < nTextPixelHeight
.head 10 -  Set lnMaxHeight = nTextPixelHeight
.head 8 -  Call SelectObject( hDC, hGDIObj )
.head 8 -  Call ReleaseDC( hWndItem, hDC )
.head 8 -  Set bOk	= bOk And SalSetWindowSize( hWndItem, SalPixelsToFormUnits( hWndItem, lnMaxWidth, FALSE ), SalPixelsToFormUnits( hWndItem, lnMaxHeight * lnLineBreaks, TRUE ) )
.head 7 -  Return bOk
.head 4 -  Message Actions
.head 2 +  Default Classes
.head 3 -  MDI Window: cBaseMDI
.head 3 -  Form Window:
.head 3 -  Dialog Box:
.head 3 -  Table Window:
.head 3 -  Quest Window:
.head 3 -  Data Field:
.head 3 -  Spin Field:
.head 3 -  Multiline Field:
.head 3 -  Pushbutton:
.head 3 -  Radio Button:
.head 3 -  Option Button:
.head 3 -  Check Box:
.head 3 -  Child Table:
.head 3 -  Quest Child Window: cQuickDatabase
.head 3 -  List Box:
.head 3 -  Combo Box:
.head 3 -  Picture:
.head 3 -  Vertical Scroll Bar:
.head 3 -  Horizontal Scroll Bar:
.head 3 -  Column:
.head 3 -  Background Text:
.head 3 -  Group Box:
.head 3 -  Line:
.head 3 -  Frame:
.head 3 -  Custom Control:
.head 3 -  ActiveX:
.head 2 -  Application Actions


Gupta.narod.ru - примеры программирования на Gupta Team Developer 2005 (GTD, CTD, TOM, Quest, SQLTalk, Report Builder, SQLWindows, SQLBase, Oracle, Web Developer, Team Object Manager)

Google
 

Return to http://gupta.narod.ru/


Сайт создан в системе uCoz