//***************************************************************************************** // Copyright (c) 2000 Michael Kurz // All rights reserved. // If you want to use this source in your applications conatct: // // $FileName : cEditorElementsView.Pkg // $ProjectName : CODEMAX EDITOR // $Author : Michael Kurz // $Created : 01-25-2001 @ 19:00 // // Contents: // Class which displays the Objects, Procedures, .... for the editor. // // // $Rev History // //***************************************************************************************** Use cTabDialogEx.Pkg Use cTreeViewEx.Pkg Use mFiles.Pkg //Use PopupMenu.pkg Use cToolbar.pkg Use Findfile.pkg Use drgndrop.pkg Use Menu\TH3FileTabContextMenu.mn Use Menu\TH3CodeExplorerContext.mn Struct tEditorElement String sName Handle hItem End_Struct Class cEditorElementTreeView Is a cTreeViewEx // Register_Procedure onWMMouseUp Import_Class_Protocol cDragAndDrop_mx // Enable Drag and Drop. Procedure Construct_Object Forward Send Construct_Object // Set External_Message WM_LBUTTONUP To msg_onWMMouseUp Property tEditorElement[] ptEditorElements Property String psFilter "" Property Integer piLastFiltered 0 Property Integer piClicked 0 Property Integer piCurrentItemClicked 0 Property Integer piSendClickDirect False Property Integer piIsCodeView 0 Property Integer phFont 0 Set TreeSortedState To False Set TreeRetainSelState To True Set TreeIndentWidth To 2 Object oFiles Is a Set End_Object Object oFileItems Is a Set End_Object On_Key kEnter Send OnItemClicked On_Key kCancel Send Request_Cancel // Temp Array for Registering Class in the IDE Object oTmpClassArray Is an Array End_Object //Send DefaultFontSize End_Procedure Procedure FindFirstFilterItem String sFilter Integer iElement tEditorElement[] ltEditorElements tEditorElement ltEditorElement Send DoExpandAll Move sFilter to ltEditorElement.sName Move (SearchArray(ltEditorElement, ltEditorElements)) to iElement If (iElement>=0) Begin Send DoMakeItemVisible ltEditorElements[iElement].hItem Set CurrentTreeItem to ltEditorElements[iElement].hItem End End_Procedure Function LastFilterItem String sFilter tEditorElement[] ByRef ltEditorElements Returns Integer Integer iCount iElement iElements Move (SizeOfArray(ltEditorElements)) to iElements For iElement from 0 to (iElements-1) If (ltEditorElements[iElement].sName contains sFilter) ; Increment iCount Loop Function_Return iCount End_Function Procedure MoveToFilterItemUp Integer iLast iCount iElement iElements String sFilter Handle hElement hLast tEditorElement[] ltEditorElements Get ptEditorElements to ltEditorElements Get psFilter to sFilter If (sFilter="") Procedure_Return Get piLastFiltered to iLast Decrement iLast If (iLast<=0) Get LastFilterItem sFilter (<EditorElements) to iLast Send DoExpandAll // Move (SizeOfArray(ltEditorElements)) to iElements If (iElements<>0) Begin Send DoExpandAll For iElement from 0 to (iElements-1) If (ltEditorElements[iElement].sName contains sFilter) Begin Increment iCount Move ltEditorElements[iElement].hItem to hLast End If (iCount=iLast) Begin Set piLastFiltered to iCount Move ltEditorElements[iElement].hItem to hElement Move iElements to iElement // Break Loop End If (iCount > iLast) Begin Set piLastFiltered to iCount Move hLast to hElement End Loop If hElement Begin Send DoMakeItemVisible hElement Set CurrentTreeItem to hElement End End // End_Procedure Procedure MoveToFilterItemDown Integer iLast iCount iElement iElements String sFilter Handle hElement hFirst tEditorElement[] ltEditorElements Get ptEditorElements to ltEditorElements Get psFilter to sFilter If (sFilter="") Procedure_Return Get piLastFiltered to iLast Increment iLast // Move (SizeOfArray(ltEditorElements)) to iElements If (iElements<>0) Begin Send DoExpandAll For iElement from 0 to (iElements-1) If (ltEditorElements[iElement].sName contains sFilter) Begin Increment iCount If (iCount=1) Move ltEditorElements[iElement].hItem to hFirst End If (iCount=iLast) Begin Set piLastFiltered to iCount Move ltEditorElements[iElement].hItem to hElement Move iElements to iElement // Break Loop End If (iCount < iLast) Begin Set piLastFiltered to 1 Move hFirst to hElement End Loop If hElement Begin Send DoMakeItemVisible hElement Set CurrentTreeItem to hElement End End // End_Procedure Procedure OnCreateTree Integer iCode hRoot hItem iFnd Get piIsCodeView To iCode If (iCode) Begin Send OpenTH3DB of ghoApplication VDFCLS.File_Number Clear VDFCLS Indicate found True While (found) Find Gt VDFCLS by Index.1 // NAME Move (found) To iFnd Indicate found as VDFCLS.Base Eq "Y" If (found) Get AddTreeItemEx (Trim(VDFCLS.NAME)) 0 99999999 "vdfcls.bmp" "vdfcls.bmp" To hItem Indicate found as (iFnd) Loop Send CloseTH3DB of ghoApplication VDFCLS.File_Number End Forward Send OnCreateTree End_Procedure Procedure Page_Object Integer iFlag Forward Send Page_Object iFlag Send ColorsLikeEdit End_Procedure // Cancel the errorlistwindow with the escape key. Procedure Request_Cancel If (ghoOutputPane<>0) Begin Send CloseOutputPane of ghoOutputPane Set Windows_Override_State To True // don't pass the message to Windows. End // this prevents the annoying "ding" sound by windows End_Procedure // as otherwise it will still send the keycodes to the queue Procedure ChangeBmp Integer iCur iData hoParser iType String sClsName Get CurrentTreeItem To iCur Get ItemData iCur To iData If (iData Lt 5000) Function_Return "" Get LocateElement 0 (iData-5000) To hoParser // Get the CurrentElement. Get psCEl_psClass Of hoParser To sClsName Get piCEl_piType Of hoParser To iType If (iType Ne MK_OBJECT) Procedure_Return Send Request_RegisterNewClass To Desktop sClsName End_Procedure Register_Object oEdit Procedure RegisterClsIDE Integer iCur iData hoParser iType iLineStart iLineEnd iLine hoID Integer hoArray String sLine sFileName Get CurrentTreeItem To iCur Get ItemData iCur To iData If (iData Lt 5000) Function_Return "" Get LocateElement 0 (iData-5000) To hoParser // Get the CurrentElement. If (hoParser) Begin Get piCEl_piType Of hoParser To iType Get piCEl_piLine Of hoParser To iLineStart Get piCEl_piEndLine Of hoParser To iLineEnd If (iType Eq MK_CLASS) Begin Get GetEditViewID To hoID Move (oEdit(hoID)) To hoID Move (oTmpClassArray(Self)) To hoArray Send Delete_Data To hoArray For iLine From iLineStart To iLineEnd Get value Of hoID Item iLine To sLine If (Trim(sLine)) Ne "" ; Set value Of hoArray Item (Item_Count(hoArray)) To sLine End If (Item_Count(hoArray)) Gt 0 Begin Get GetFileName To sFileName Send IDERegisterClass To Desktop (psVDFRegistryVersion(ghoEditorProperties)) (psCurWrkSpace(ghoWorkSpaceHandlerEx)) sFileName hoArray End Else Send Info_Box (_T("The class could not be located.",1581)) (_T("Information", 1582)) End Else Send Info_Box (_T("The chosen element is not a class.", 1583)) (_T("Information", 1584)) End End_Procedure Procedure RegisterClsDB Integer iCur iData hoParser iType iClsCode String sClsName Get CurrentTreeItem To iCur Get ItemData iCur To iData If (iData Lt 5000) Function_Return "" Get LocateElement 0 (iData-5000) To hoParser // Get the CurrentElement. Get psCEl_psClass Of hoParser To sClsName Get piCEl_piType Of hoParser To iType If iType Eq MK_CLASS Begin // showln "Class" // get GetElementsListEx of hoParser End Get VDFCls_Search sClsName 0 0 to iClsCode If (iClsCode=0) Send Request_RegisterNewClass To Desktop sClsName Else Begin If (iType Eq MK_CLASS) Begin Get psCEl_psName Of hoParser To sClsName Get VDFCls_Search sClsName 0 0 to iClsCode If (iClsCode=0) Send Request_RegisterNewClass To Desktop sClsName Else Send Info_Box (_T("Class already registered!", 1585)) (_T("Information", 1584)) End Else Send Info_Box (_T("Class already registered!", 1585)) (_T("Information", 1584)) End End_Procedure // Delivers the DataOf the DragedItem. Function DragAndDrop_DataType Returns String Integer iCur iData hoParser iType Get CurrentTreeItem To iCur Get ItemData iCur To iData If (iData Lt 5000) Function_Return "" // VDF Standard Classes If (iData Eq 99999999) Function_Return "DD_CLASS" // Object oClassName is a cClassName // Get LocateElement 0 (iData-5000) To hoParser // Get the CurrentElement. If (hoParser) Begin Get piCEl_piType Of hoParser To iType If (iType Eq MK_CLASS) Function_Return "DD_CLASS" // Object oClassName is a cClassName Else If (iType Eq MK_Object) Function_Return "DD_OBJECT" // Object1.Object2 Else Function_Return "DD_METHOD" // Procedure,Function,Property,SetProcedure End Function_Return "" End_Function // Gets the Text. Function DragAndDrop_GetData Returns String Integer iCur iData hoParser iType String sClsName sName sRet Register_Object oPP Get CurrentTreeItem To iCur Get ItemData iCur To iData If ((iData Lt 5000)And(iData<>99999999)) Function_Return "" If (iData<>99999999) Get LocateElement 0 (iData-5000) To hoParser Else Begin Get ItemLabel iCur To sClsName // Send OpenTH3DB of ghoApplication VDFCLS.File_Number Clear VDFCLS Move sClsName To VDFCLS.Name Find Eq VDFCLS by Index.1 // NAME If (found) Begin Send PopUp To (oPP(Self)) (Trim(VDFCLS.NAME)) VDFCLS.CODE Get psSource Of (oPP(Self)) To sRet End Else Move "" To sRet Send CloseTH3DB of ghoApplication VDFCLS.File_Number Function_Return sRet End //Get LocateElement 0 (iData-5000) To hoParser If (hoParser) Begin Get piCEl_piType Of hoParser To iType If (iType Eq MK_CLASS) Begin Get psCEl_psName Of hoParser To sClsName If (Lowercase(Left(sClsName,1))) Eq "c" Move (Right(sClsName,Length(sClsName)-1)) To sName Else Move sClsName To sName Move (Append("o",sName)) To sName Append sRet "\sObject " sName " is a " sClsName "\n" Append sRet "\t /" "/AB-StoreTopStart\n" Append sRet "\t /" "/AB-StoreTopEnd\n\n" Append sRet "\t /" "/AB-StoreStart\n" Append sRet "\t /" "/AB-StoreEnd\n" Append sRet "\tEnd_Object\n" End Else If (iType Eq MK_Object) Begin Get psCEl_psRef Of hoParser To sRet End Else Begin // Procedure,Function,Property,SetProcedure Get psCEl_psName Of hoParser To sName Append sRet "@" If (iType Eq MK_PROCEDURE) Append sRet "Send " sName " to @DEST@" If (iType Eq MK_SETPROCEDURE) Append sRet "Set " sName " of @DEST@ to " If (iType Eq MK_FUNCTION) Append sRet "Get " sName " of @DEST@ to " If (iType Eq MK_PROPERTY) Append sRet "Set " sName " of @DEST@ to " Get LocateElement MK_OBJECT (iData-5000) To hoParser If hoParser Begin Get psCEl_psRef Of hoParser To sName Move (Append(sName,sRet)) To sRet End End End Function_Return sRet End_Function Function DragAndDrop_Success Returns Integer Function_Return 1 End_Function // Function DragAndDrop_IconFile String sDataType returns String // Function_Return "Test2.cur" // End_Function Procedure Mouse_Up Integer iP1 If Not (piSendClickDirect(Self)) If (piClicked(Self)) Send onItemClicked Set piClicked To False End_Procedure Procedure Mouse_Click Integer iP1 Set piClicked To True Set piCurrentItemClicked To (CurrentTreeItem(Self)) Forward Send Mouse_Click iP1 If (piSendClickDirect(Self)) Send OnItemClicked End_Procedure // **WvA: 10-29-2005 This patches a stack overflow that happens // if the system tries to find the next focusable object. // Our codemax control is positioned before the objects here.. // Procedure Switch Handle hoCodeMaxEditor Get phoCodeMaxEditor To hoCodeMaxEditor If (hoCodeMaxEditor) Begin Send Activate To hoCodeMaxEditor End End_Procedure // Switch Register_Object oEdit Procedure OnItemClicked Integer iCur iData iType String sFile sPathFile Get CurrentTreeItem To iCur If (iCur<>0) Begin Get ItemData iCur To iData If iData Ge 5000 Send FindObject iCur iData Else Begin Move (Value(oFiles(Self),iData)) To sFile Get CheckType sFile To iType If (iType=KPH_FILE_EDITABLE) Begin Get_File_Path sFile To sPathFile If (sPathFile <> "") Begin // Case sensitivity correction if needed, might not fix path case, but // does take care of file's case, which is "good enough" as it doesn't // bite code maintainance tools or mess up preferred file case Get FileNameOnDisk sPathFile To sPathFile Send CAOpenFile sPathFile End End Else If (iType=KPH_FILE_MENU) Begin Send CAOpenFile sFile // **WvA 27-6-2003 Changed in a to-do until we decide what we do for // menu-editor. // ToDo: //Send Info_Box "OOP's! It is a menu!" End Else Send Info_Box sFile (_T("Can't open the file", 1586)) (_T("Information", 1584)) End End End_Procedure // Destroys the font object if created. Procedure Request_DestroyFontObject Integer iRet If (phFont(Self)) Gt 0 Begin Move (DeleteObject(phFont(Self))) To iRet Set phFont To 0 End End_Procedure // Gets the Color Text and Background Color from the Edit and sets the colors of // the Treeview to them. Procedure ColorsLikeEdit Integer hoID Integer iTextColor iWindowColor Integer iVoid String sFont Get GetEditViewID To hoID Move (oEdit(hoID)) To hoID Get piTextColor Of hoID To iTextColor Get piWindowColor Of hoID To iWindowColor If iTextColor Eq -1 Move (GetSysColor(COLOR_WINDOWTEXT)) To iTextColor If iWindowColor Eq -1 Move (GetSysColor(COLOR_WINDOW)) To iWindowColor Set TextColor To itextColor Set Color To iWindowColor // Change for VDF8 and up // *WvA 05-11-2003 This fixes the background color and // textcolor of the items in the treeview. // This was not displayed properly if the background wasn't white. Set piTextColor To iTextColor Set piBackColor to iWindowColor Set piLineColor to iTextColor End_Procedure Procedure DefaultFontSize Boolean bUseWindowsFont Move False To bUseWindowsFont Get pbUseWindowsFont of ghoApplication To bUseWindowsFont If (bUseWindowsFont) Begin // just use system default for now, but below works just fine. //Set Typeface To "DejaVu Sans Mono" //Set FontPointHeight To 10 End End_Procedure // DefaultFontSize Register_Object oParser Procedure FindObject Integer iCurItem Integer iData Integer hoID iRet iLine hoParser Get GetEditViewID To hoID If (iData<99999990) Begin Move (iData-5000) To iLine Send GotoLine To (oEdit(hoID)) iLine End End_Procedure Register_Object oParser Function LocateElement Integer iForceType Integer iLine Returns Integer Integer hoID iRet hoParser Get GetEditViewID To hoID Move (oParser(hoID)) To hoParser Get LineToItemEx Of hoParser iForceType iLine To iRet If (iRet) Function_Return hoParser Function_Return 0 End_Function // Delivers the Handle of a file. Function HandleOfFile String sFile Returns Handle Integer iC Get Find_Element Of oFiles (Lowercase(sFile)) To iC If iC Ge 0 Function_Return (Value(oFileItems(Self),iC)) Else Function_Return 0 End_Function // Removes a File. Procedure RemoveFile String sFile Integer iRet iC iItem Get Find_Element Of oFiles (Lowercase(Trim(sFile))) To iC If iC Ge 0 Begin Get value Of oFileItems Item iC To iItem Send DoDeleteItem iItem Send Delete_Item To oFiles iC Send Delete_Item To oFileItems iC End End_Procedure // Adds a file entry. Function AddFile String sFile Integer iOpen Returns Integer Integer iRet iC hoID String sFile2 sBmp If iOpen Move "FileOpened.Bmp" To sBmp Else Move "FileClosed.Bmp" To sBmp If (Window_Handle(Self)) Eq 0 Begin Move (Focus(Desktop)) To hoID Set Visible_State Of (Parent(Self)) To False Send Page_Object To (Parent(Self)) True Send Page_Object True Delegate Send Request_Switch_To_Tab 0 3 Send Activate To hoID End If iOpen If sFile Eq gsCurrentProgramFile Begin Move "FileOpenedCur.bmp" To sBmp End Get Find_Element Of oFiles (Lowercase(Trim(sFile))) To iC If iC Lt 0 Begin Move (Item_Count(oFiles(Self))) To iC Move (FileFromPath(sFile)) To sFile2 Get AddTreeItemEx sFile2 0 iC sBmp sBmp To iRet Set value Of oFiles Item iC To (Lowercase(Trim(sFile))) Set value Of oFileItems Item iC To iRet End Else Begin If iOpen Begin Set ItemBitmap (Value(oFileItems(Self),iC)) To sBmp Set ItemSelectedBitmap (Value(oFileItems(Self),iC)) To sBmp End End Function_Return (Value(oFileItems(Self),iC)) End_Function End_Class Class cCodeFileTreeViewEx is a cEditorElementTreeView // Set Current Item when mouse down. // And Start PopupMenu when entered. Procedure Mouse_Down2 Integer iT Handle hItem String sFile Integer iData If (Floating_Menu_Object(Self)) Begin Get CurrentTreeItem to hItem Get ItemData hItem to iData Get Value of oFiles iData to sFile Set psFileName of (Floating_Menu_Object(Self)) to sFile Send Popup to (Floating_Menu_Object(Self)) End End_Procedure End_Class Class cEditorElementsSearch is a Form Procedure Construct_Object Forward Send Construct_Object Property Handle phoElementsTree 0 Set Size to 11 196 Set Location To 14 0 // Don't use automatic anchoring, this is handled in GuiSize override in // cEditorElements //Set peAnchors to anTopLeftRight Set Color to gtColorer[EC_TEXT].iBackC Set Prompt_Button_Mode to PB_PromptOn Set Form_Button_Bitmap 0 to "ClearFilter.bmp" On_Key Key_Down_Arrow Send GotoTree On_Key Key_Tab Send GotoTree On_Key Key_Enter Send GotoTree On_Key kPrompt Send None On_Key kClear Send ClearFilter End_Procedure Procedure GotoTree If (phoElementsTree(Self)) Begin Send Activate to (phoElementsTree(Self)) Send MoveToFilterItemDown to (phoElementsTree(Self)) End End_Procedure Procedure OnChange String sFilter Handle hoTree Get Value to sFilter Move (Uppercase(sFilter)) to sFilter Get phoElementsTree to hoTree Set psFilter of hoTree to sFilter Set piLastFiltered of hoTree to 0 Set Color to gtColorer[EC_TEXT].iBackC If (sFilter<>"") Set Color to (RGB(255,200,200)) Send FindFirstFilterItem to hoTree sFilter End_Procedure Procedure ColorsLikeEdit Integer hoID Integer iTextColor iWindowColor Integer iVoid String sFont Get GetEditViewID to hoID Move (oEdit(hoID)) to hoID Get piTextColor of hoID to iTextColor Get piWindowColor of hoID to iWindowColor If iTextColor Eq -1 Move (GetSysColor(COLOR_WINDOWTEXT)) to iTextColor If iWindowColor Eq -1 Move (GetSysColor(COLOR_WINDOW)) to iWindowColor Set TextColor to itextColor Set Color to iWindowColor End_Procedure Procedure ClearFilter String sValue Get Value to sValue If (sValue<>"") Begin Set Value to "" End End_Procedure // not really a prompt, but a delete text in one click option Procedure Prompt Send ClearFilter End_Procedure End_Class Class cElementsButton is a Button Procedure Construct_Object Forward Send Construct_Object Property Handle phoElementsTree 0 Property Integer piMoveUp 0 On_Key Key_Down_Arrow Send GotoTree On_Key Key_Tab Send GotoTree End_Procedure Procedure GotoTree If (phoElementsTree(Self)) Begin Send Activate to (phoElementsTree(Self)) If (piMoveUp(Self)) ; Send MoveToFilterItemUp to (phoElementsTree(Self)) Else ; Send MoveToFilterItemDown to (phoElementsTree(Self)) End End_Procedure Procedure OnClick Send GotoTree End_Procedure End_Class Class cEditorElements Is a Container3d Procedure Construct_Object Forward Send Construct_Object Property Handle phoCodeView 0 Property Handle phoFilesView 0 Property Integer piPerfCounter 0 Set Border_Style to border_none //border_StaticEdge Object oTabDialog Is a cTabDialogEx Set GuiLocation To 0 0 //3 3 Set piButtonState To Button_Bottom // Buttons on the bottom! Set skip_button_mode To SBM_ALWAYS Set pbAllowKeyNavigation to False // fix crash tab key after activating tabpage Object oTabPage1 Is a cTabPageEx Set Label to (_T("Code", 1594)) // "CodeView" Set Bitmap To "CodeExplorer16.bmp" (RGB(255,255,0)) Set Button_Shadow_State To True Object oEditorElementView Is a cEditorElementTreeView Set piSendClickDirect To True Set phoCodeView to Self Object oCodeContextMenu is a cCodeExplorerContextMenu End_Object Set Floating_Menu_Object to (oCodeContextMenu(Self)) Object oImageList Is an cImageListEx Set Bitmap_Size To 16 16 Set ImageList_Size To 100 1 Send ImageList_Create // create the ImageList End_Object Set ImageListObject To (oImageList(Self)) End_Object Object oSearch is a cEditorElementsSearch Set phoElementsTree to oEditorElementView End_Object Object oSearchDown is a cElementsButton Set Bitmap to "down.bmp" Set phoElementsTree to oEditorElementView End_Object Object oSearchUp is a cElementsButton Set Bitmap to "up.bmp" Set piMoveUp to True Set phoElementsTree to oEditorElementView End_Object End_Object Object oTabPage2 Is a cTabPageEx Set Label to (_T("Files", 1595)) //"FileView" Set Bitmap To "Dependencies16.bmp" (RGB(255,255,0)) Set Button_Shadow_State To True Set phoFilesView to Self Object oFilesView is a cCodeFileTreeViewEx Set Floating_Menu_Object to (oFileContextMenu(Self)) Object oImageList2 Is an cImageListEx Set Bitmap_Size To 16 16 Set ImageList_Size To 100 1 Send ImageList_Create // create the ImageList End_Object Set ImageListObject To (oImageList2(Self)) End_Object End_Object End_Object End_Procedure Procedure NotifyColorEditorChange Send ColorsLikeEdit to oSearch Send ColorsLikeEdit To oEditorElementView Send ColorsLikeEdit to oFilesView End_Procedure Procedure Set GuiSize Integer iY Integer iX Integer hoTD Integer iSearchHeight Move (oTabDialog(Self)) To hoTD Forward Set GuiSize To iY iX If hoTD Begin Set GuiSize Of hoTD To (Hi(Client_Size(Self))-15) (Low(Client_Size(Self))+1) //-6 Set GuiLocation Of oTabPage1 To 3 3 Set GuiLocation Of oTabPage2 To 3 3 Move (Hi(Client_Size(hoTD))-28) To iY Move (Low(Client_Size(hoTD))-6) To iX // Set GuiLocation of oSearch to 0 0 Move (Hi(GuiSize(oSearch))) To iSearchHeight Set GuiSize of oSearch to iSearchHeight (iX-40) // Set GuiLocation of oSearchDown to 0 (iX-40) Set GuiSize of oSearchDown to iSearchHeight 20 Set GuiLocation of oSearchUp to 0 (iX-20) Set GuiSize of oSearchUp to iSearchHeight 20 // Set GuiLocation of oEditorElementView to (iSearchHeight-1) 0 Set GuiSize of oEditorElementView to (iY-iSearchHeight) iX Set GuiSize of oFilesView to iY iX End End_Procedure // Delivers the Handle of a file. Function HandleOfFile String sFile Returns Handle Integer hoID hItem Move (oEditorElementView(oTabPage1(oTabDialog(Self)))) To hoID Function_Return (HandleOfFile(hoID,sFile)) End_Function Procedure AddFile String sFile Integer iOpen Integer hoID hItem Move (oFilesView(oTabPage2(oTabDialog(Self)))) To hoID //move (oEditorElementView(oTabPage1(oTabDialog(Self)))) to hoID Get AddFile Of hoID sFile iOpen To hItem Procedure_Return hItem End_Procedure Procedure RemoveFile String sFile Send RemoveFile To oEditorElementView sFile End_Procedure Procedure Set Current_Item Integer iItem If (iItem<>0) Begin Set CurrentTreeItem Of oEditorElementView To iItem End End_Procedure Procedure StartFillList String sFile Integer iCur hItem iRet iCounter tEditorElement[] ltEditorElements Get StartPerfCounter of ghoApplication CPC_BuildCodeExplorer sFile to iCounter Move (ResizeArray(ltEditorElements,0)) To ltEditorElements Set ptEditorElements of oEditorElementView to ltEditorElements Set piPerfCounter to iCounter Set Dynamic_Update_State Of oEditorElementView To False Set Dynamic_Update_State Of oFilesView To False //get AddFile of oEditorElementView sFile true to hItem //set piFirstItem of ghoElementsTree to hItem End_Procedure Procedure EndFillList Integer hoID hoID2 iRet Move (oEditorElementView(oTabPage1(oTabDialog(Self)))) To hoID Move (oFilesView(oTabPage2(oTabDialog(Self)))) To hoID2 Set Button_Shadow_State Of oTabPage2 To (ItemCount(hoID2) Eq 0) Set Button_Shadow_State Of oTabPage1 To (ItemCount(hoID ) Eq 0) Send SortItems To oFilesView 0 0 Set Object_Shadow_State To ((ItemCount(hoID) Eq 0) And (ItemCount(hoID2) Eq 0)) Set Dynamic_Update_State Of hoID To True Set Dynamic_Update_State Of hoID2 To True Send StopPerfCounter of ghoApplication (piPerfCounter(Self)) End_Procedure Procedure DeleteEntry Integer iItem Send DoDeleteItem To oEditorElementView iItem End_Procedure Procedure AddNewListEntry Integer iOldItem String sName String sClass Integer iParent Integer iLine Integer iType Integer pElement Integer hElement Integer iElement String sBitmap tEditorElement[] ltEditorElements Get ptEditorElements of oEditorElementView to ltEditorElements If iType Eq MK_CLASS Move (Append("Class ",sName)) To sName If iType Eq MK_SETPROCEDURE Move (Append("Set ",sName)) To sName If iType Eq MK_PROPERTY Append sName " (" sClass ")" If iOldItem Eq 0 Move TVI_FIRST to iOldItem Move (ClassBitmaps(desktop,sClass,iType)) to sBitmap If (Uppercase(sClass) contains "DATADICTIONARY") Move "ttdd16.bmp" to sBitmap Get InsertTreeItemEx of oEditorElementView sName iOldItem iParent (iLine+5000) sBitmap sBitmap to hElement Move (SizeOfArray(ltEditorElements)) to iElement Move (Uppercase(sName)) to ltEditorElements[iElement].sName Move hElement to ltEditorElements[iElement].hItem Set ptEditorElements of oEditorElementView to ltEditorElements Procedure_Return hElement End_Procedure Procedure UpdateLineNr Integer iItem Integer iLine Handle hWnd Get Window_Handle of oEditorElementView to hWnd If (hWnd<>0) Begin Set ItemData Of oEditorElementView Item iItem To (5000+iLine) End End_Procedure End_Class Class cElementImages Is a cImageList Procedure Construct_Object Forward Send Construct_Object Property Integer piImageListType ILC_COLORDDB Set piImageHeight To 8 Set piImageWidth To 8 Set piMaxImages To 10 End_Procedure Procedure DoCreate Integer cx cy dwFlags icInitial iGrowBy iColor Get piImageHeight To cy Get piImageWidth To cx Get piMaxImages To iGrowBy Get piImageListType To iColor Move (iColor+ILC_MASK) To dwFlags Set phImageList To (ImageList_Create(cx, cy, dwFlags, 0, iGrowBy)) End_Procedure Procedure OnCreate Integer iVoid Get AddTransparentImage "sysclose.bmp" clFuchsia To iVoid // 0 // Close panel End_Procedure End_Class Class cETButton Is a cToolbarButton Procedure Construct_Object Forward Send Construct_Object Set psLabel To "" Set pbAutoSize To False Set psTooltip to (_T('Close Explorer', 1587)) Set psStatusHelp To '' Set piImage To 0 End_Procedure Procedure OnClick Delegate Send OnClick End_Procedure End_Class Class cETCEButton is a cToolbarButton Procedure Construct_Object Forward Send Construct_Object Set psLabel to "" Set pbAutoSize to False Set psTooltip to (_T("Toggle VDF Controls palette.", 1588)) Set psStatusHelp to '' Set piImage to 1 End_Procedure Register_Object oTHToolPanel Procedure OnClick If (Active_State(oTHToolPanel(Self))) Send Close_Panel to (oTHToolPanel(Self)) Else Send Activate to (oTHToolPanel(Self)) End_Procedure End_Class Class cETInfoButton is a cToolbarButton Procedure Construct_Object Forward Send Construct_Object Set psLabel to "" Set pbAutoSize to False Set psTooltip to (_T("Code Explorer allows you to see\nthe component structure. Within this tool\nyou can drag'n'drop items into the Code\nEditor Window. If Object selected, you'll\nget a full object path. In case of the Class,\nyou will get an Object derived from the\nselected class.", 1589)) Set psStatusHelp to '' Set piImage to 2 End_Procedure End_Class Class cSysToolBar Is a cToolBar Procedure Construct_Object Forward Send Construct_Object Set peAlign to alNone //alBottom Set pbNoDivider To True Set pbInMdiPanel To False Set pbShowLabels To False Set pbList To False Set piButtonHeight To 10 Set piButtonWidth To 10 Set piButtonWidthMax To 10 End_Procedure Procedure End_Construct_Object Integer iHL iSH Forward Send End_Construct_Object Object oImages Is a cElementImages End_Object Set phoImageList To (oImages(Self)) Set phoImageListHot To (oImages(Self)) End_Procedure End_Class Class cElementTools Is a cSysToolBar Procedure Construct_Object Forward Send Construct_Object // Up to 7 buttons allowed Object oCloseCodeView Is a cETButton End_Object End_Procedure Procedure OnClick Delegate Send SetCodeViewVisible False End_Procedure End_Class