FUNCTION GetFormControls( cForm, lProp ) // Все контролы окна или по типам контролов LOCAL i, x, nFormHandle, nControlCount, aRetVal := {}, aProp, cType, lAdd DEFAULT cForm := _HMG_ThisFormName, ; lProp := .F. If ValType(lProp) == "C" // по типам контролов cType := ","+upper(lProp)+"," lProp := .T. EndIf nFormHandle := GetFormHandle ( cForm ) nControlCount := Len ( _HMG_aControlHandles ) For i := 1 To nControlCount lAdd := .F. If _HMG_aControlParentHandles[ i ] == nFormHandle If ValType( _HMG_aControlHandles[ i ] ) == 'N' IF ! Empty( _HMG_aControlNames[ i ] ) lAdd := .T. If ! empty(cType); lAdd := ","+ _HMG_aControlType[ i ] +"," $ cType EndIf If lAdd If lProp aAdd( aRetVal, GetHmgValue(cForm, _HMG_aControlNames[ i ]) ) ElseIf Ascan( aRetVal, _HMG_aControlNames[ i ] ) == 0 Aadd( aRetVal, _HMG_aControlNames[ i ] ) EndIf EndIf ENDIF ElseIf ValType( _HMG_aControlHandles [ i ] ) == 'A' For x := 1 To Len ( _HMG_aControlHandles[ i ] ) IF ! Empty( _HMG_aControlNames[ i ] ) lAdd := .T. If ! empty(cType); lAdd := ","+ _HMG_aControlType[ i ] +"," $ cType EndIf If lAdd If lProp aAdd( aRetVal, GetHmgValue(cForm, _HMG_aControlNames[ i ]) ) ElseIf Ascan( aRetVal, _HMG_aControlNames[ i ] ) == 0 Aadd( aRetVal, _HMG_aControlNames [ i ] ) EndIf EndIf ENDIF Next x EndIf EndIf Next i If ! lProp; RETURN ASort( aRetVal ) EndIf RETURN aRetVal FUNCTION GetHmgValue( cForm, cControl ) // Значения переменных _HMG_... окна, контрола LOCAL i, k := 0, aRet := {} DEFAULT cForm := _HMG_ThisFormName If Valtype(cForm) == "N"; i := AScan(_HMG_cFormHandles, cForm) Else ; i := GetFormIndex(cForm) EndIf If i > 0 If Valtype(cControl) == "N"; k := AScan(_HMG_aControlHandles, cForm) ElseIf ! empty(cControl) ; k := GetControlIndex(cControl, cForm) EndIf If empty(cControl) aAdd( aRet, {"_HMG_aFormNames " , _HMG_aFormNames [ i ]} ) aAdd( aRet, {"_HMG_aFormHandles " , _HMG_aFormHandles [ i ]} ) aAdd( aRet, {"_HMG_aFormActive " , _HMG_aFormActive [ i ]} ) aAdd( aRet, {"_HMG_aFormType " , _HMG_aFormType [ i ]} ) aAdd( aRet, {"_HMG_aFormParentHandle " , _HMG_aFormParentHandle [ i ]} ) aAdd( aRet, {"_HMG_aFormReleaseProcedure " , _HMG_aFormReleaseProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormInitProcedure " , _HMG_aFormInitProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormToolTipHandle " , _HMG_aFormToolTipHandle [ i ]} ) aAdd( aRet, {"_HMG_aFormContextMenuHandle " , _HMG_aFormContextMenuHandle [ i ]} ) aAdd( aRet, {"_HMG_aFormMouseDragProcedure " , _HMG_aFormMouseDragProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormSizeProcedure " , _HMG_aFormSizeProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormClickProcedure " , _HMG_aFormClickProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormMouseMoveProcedure " , _HMG_aFormMouseMoveProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormMoveProcedure " , _HMG_aFormMoveProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormDropProcedure " , _HMG_aFormDropProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormDeleted " , _HMG_aFormDeleted [ i ]} ) aAdd( aRet, {"_HMG_aFormBkColor " , _HMG_aFormBkColor [ i ]} ) aAdd( aRet, {"_HMG_aFormPaintProcedure " , _HMG_aFormPaintProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormNoShow " , _HMG_aFormNoShow [ i ]} ) aAdd( aRet, {"_HMG_aFormNotifyIconName " , _HMG_aFormNotifyIconName [ i ]} ) aAdd( aRet, {"_HMG_aFormNotifyIconToolTip " , _HMG_aFormNotifyIconToolTip [ i ]} ) aAdd( aRet, {"_HMG_aFormNotifyIconLeftClick " , _HMG_aFormNotifyIconLeftClick [ i ]} ) aAdd( aRet, {"_HMG_aFormNotifyIconDblClick " , _HMG_aFormNotifyIconDblClick [ i ]} ) aAdd( aRet, {"_HMG_aFormGotFocusProcedure " , _HMG_aFormGotFocusProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormLostFocusProcedure " , _HMG_aFormLostFocusProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormReBarHandle " , _HMG_aFormReBarHandle [ i ]} ) aAdd( aRet, {"_HMG_aFormNotifyMenuHandle " , _HMG_aFormNotifyMenuHandle [ i ]} ) aAdd( aRet, {"_HMG_aFormBrowseList " , _HMG_aFormBrowseList [ i ]} ) aAdd( aRet, {"_HMG_aFormSplitChildList " , _HMG_aFormSplitChildList [ i ]} ) aAdd( aRet, {"_HMG_aFormVirtualHeight " , _HMG_aFormVirtualHeight [ i ]} ) aAdd( aRet, {"_HMG_aFormVirtualWidth " , _HMG_aFormVirtualWidth [ i ]} ) aAdd( aRet, {"_HMG_aFormFocused " , _HMG_aFormFocused [ i ]} ) aAdd( aRet, {"_HMG_aFormScrollUp " , _HMG_aFormScrollUp [ i ]} ) aAdd( aRet, {"_HMG_aFormScrollDown " , _HMG_aFormScrollDown [ i ]} ) aAdd( aRet, {"_HMG_aFormScrollLeft " , _HMG_aFormScrollLeft [ i ]} ) aAdd( aRet, {"_HMG_aFormScrollRight " , _HMG_aFormScrollRight [ i ]} ) aAdd( aRet, {"_HMG_aFormHScrollBox " , _HMG_aFormHScrollBox [ i ]} ) aAdd( aRet, {"_HMG_aFormVScrollBox " , _HMG_aFormVScrollBox [ i ]} ) aAdd( aRet, {"_HMG_aFormBrushHandle " , _HMG_aFormBrushHandle [ i ]} ) aAdd( aRet, {"_HMG_aFormFocusedControl " , _HMG_aFormFocusedControl [ i ]} ) aAdd( aRet, {"_HMG_aFormGraphTasks " , _HMG_aFormGraphTasks [ i ]} ) aAdd( aRet, {"_HMG_aFormMaximizeProcedure " , _HMG_aFormMaximizeProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormMinimizeProcedure " , _HMG_aFormMinimizeProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormRestoreProcedure " , _HMG_aFormRestoreProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormAutoRelease " , _HMG_aFormAutoRelease [ i ]} ) aAdd( aRet, {"_HMG_aFormInteractiveCloseProcedure" , _HMG_aFormInteractiveCloseProcedure [ i ]} ) aAdd( aRet, {"_HMG_aFormMinMaxInfo " , _HMG_aFormMinMaxInfo [ i ]} ) aAdd( aRet, {"_HMG_aFormActivateId " , _HMG_aFormActivateId [ i ]} ) aAdd( aRet, {"_HMG_aFormMiscData1 " , _HMG_aFormMiscData1 [ i ]} ) ElseIf k > 0 aAdd( aRet, {"_HMG_aControlType " , _HMG_aControlType [ k ]} ) aAdd( aRet, {"_HMG_aControlNames " , _HMG_aControlNames [ k ]} ) aAdd( aRet, {"_HMG_aControlHandles " , _HMG_aControlHandles [ k ]} ) aAdd( aRet, {"_HMG_aControlParentHandles " , _HMG_aControlParentHandles [ k ]} ) aAdd( aRet, {"_HMG_aControlIds " , _HMG_aControlIds [ k ]} ) aAdd( aRet, {"_HMG_aControlProcedures " , _HMG_aControlProcedures [ k ]} ) aAdd( aRet, {"_HMG_aControlPageMap " , _HMG_aControlPageMap [ k ]} ) aAdd( aRet, {"_HMG_aControlValue " , _HMG_aControlValue [ k ]} ) aAdd( aRet, {"_HMG_aControlInputMask " , _HMG_aControlInputMask [ k ]} ) aAdd( aRet, {"_HMG_aControllostFocusProcedure" , _HMG_aControllostFocusProcedure [ k ]} ) aAdd( aRet, {"_HMG_aControlGotFocusProcedure " , _HMG_aControlGotFocusProcedure [ k ]} ) aAdd( aRet, {"_HMG_aControlChangeProcedure " , _HMG_aControlChangeProcedure [ k ]} ) aAdd( aRet, {"_HMG_aControlDeleted " , _HMG_aControlDeleted [ k ]} ) aAdd( aRet, {"_HMG_aControlBkColor " , _HMG_aControlBkColor [ k ]} ) aAdd( aRet, {"_HMG_aControlFontColor " , _HMG_aControlFontColor [ k ]} ) aAdd( aRet, {"_HMG_aControlDblClick " , _HMG_aControlDblClick [ k ]} ) aAdd( aRet, {"_HMG_aControlHeadClick " , _HMG_aControlHeadClick [ k ]} ) aAdd( aRet, {"_HMG_aControlRow " , _HMG_aControlRow [ k ]} ) aAdd( aRet, {"_HMG_aControlCol " , _HMG_aControlCol [ k ]} ) aAdd( aRet, {"_HMG_aControlWidth " , _HMG_aControlWidth [ k ]} ) aAdd( aRet, {"_HMG_aControlHeight " , _HMG_aControlHeight [ k ]} ) aAdd( aRet, {"_HMG_aControlSpacing " , _HMG_aControlSpacing [ k ]} ) aAdd( aRet, {"_HMG_aControlContainerRow " , _HMG_aControlContainerRow [ k ]} ) aAdd( aRet, {"_HMG_aControlContainerCol " , _HMG_aControlContainerCol [ k ]} ) aAdd( aRet, {"_HMG_aControlPicture " , _HMG_aControlPicture [ k ]} ) aAdd( aRet, {"_HMG_aControlContainerHandle " , _HMG_aControlContainerHandle [ k ]} ) aAdd( aRet, {"_HMG_aControlFontName " , _HMG_aControlFontName [ k ]} ) aAdd( aRet, {"_HMG_aControlFontSize " , _HMG_aControlFontSize [ k ]} ) aAdd( aRet, {"_HMG_aControlFontAttributes " , _HMG_aControlFontAttributes [ k ]} ) aAdd( aRet, {"_HMG_aControlToolTip " , _HMG_aControlToolTip [ k ]} ) aAdd( aRet, {"_HMG_aControlRangeMin " , _HMG_aControlRangeMin [ k ]} ) aAdd( aRet, {"_HMG_aControlRangeMax " , _HMG_aControlRangeMax [ k ]} ) aAdd( aRet, {"_HMG_aControlCaption " , _HMG_aControlCaption [ k ]} ) aAdd( aRet, {"_HMG_aControlVisible " , _HMG_aControlVisible [ k ]} ) aAdd( aRet, {"_HMG_aControlHelpId " , _HMG_aControlHelpId [ k ]} ) aAdd( aRet, {"_HMG_aControlFontHandle " , _HMG_aControlFontHandle [ k ]} ) aAdd( aRet, {"_HMG_aControlBrushHandle " , _HMG_aControlBrushHandle [ k ]} ) aAdd( aRet, {"_HMG_aControlEnabled " , _HMG_aControlEnabled [ k ]} ) aAdd( aRet, {"_HMG_aControlMiscData1 " , _HMG_aControlMiscData1 [ k ]} ) aAdd( aRet, {"_HMG_aControlMiscData2 " , _HMG_aControlMiscData2 [ k ]} ) EndIf EndIf RETURN aRet
|