Sei sulla pagina 1di 37

Hbide

cross-platform intelligent IDE for productive Harbour


currently (March 2012) is out of development stage and works fine What is Hbide...? Hbide is inspired by and made simple any operation with harbour is a tool that will allow Edit, Compile, Debug in a visual cycle and is written in pure harbour code using xhbp.lib as framework library.
With this tool you can use harbour in a visual way. If you have any difficulties to build it from sources, I have post a compiled version ready to run in windows. Setup install in path c:\harbour\Hbide and follow its link to Hbide (shared with google doc) Please first uninstall previously installed Hbide versions Visit the online documentation Download harbour binary with Hbide and hbmk2 compiled each Nightly if you want be ready to use latest harbour version. During installation remember choice ide for having hbide installed

When was Hbide born...?


The very first time screenshot http://article.gmane.org/gmane.comp.lang.harbour.devel/21876/match=Hbide+screenshoot Announce http://article.gmane.org/gmane.comp.lang.harbour.devel/21837/match=Hbide

How does Hbide work...?


Hbide is Harbour RAD IDE written completely with Harbour syntax, with many modules available, such as editor with intellisense and visual theming for allowing different look and feel of applications, and has powerfull search tools Hbide runs on many 32 or 64 bits platforms including Windows, Linux, Mac OS X

Hbide will boost your productivity because it allows a development life cycle designed to give much faster development and higher-quality results than those achieved with the traditional lifecycle. Hbide is in alpha stage and is under continuing development

Hbide is a better ide for xbase world and the only things not yet present to be the best ide of the world are:

Visual Debugger Form editor Object Browser Svn integration

As you can see in the screen shot, Hbide allows edit , save and Build (compile) your project. Using the Hbide toolbar you can:

Create or open project or add single file Print the source code Multi level Undo Entirely compile and lanunch a project source with: compilation Is possible also compile without launch with , or without the incremental

Find a text in opened source Editing command are Cut,Copy,Paste,Select all "Set Mark" and "Goto line" toolbar actions

ZoomIn, ZoomOut feature, currently via toolbar

Exit from Hbide Other function are in left bar


Move one line up,down Delete line Duplicate line

View line number

auto indentation and keyword capitalization selected block in comment Stream comment Indent selected rows

Single to double quote

Doble to single quote Other are in right bar for managing docs
View/Toggle function list or output console or project tree windows 6*en Hbide help Harbour documentation Using harbour documentation you can read the harbour documentation related to each internal function


Function list Project function lookup Project Properties Compile enviroment Code Skeleton Theme manager Find in files Output console

Project management features


First step
Open Project using menu: File Open Project

Easy compile, edit, debug cycle


It is easy using Hbide to jump from errors to the source line that has generated the error ! If your source contains an error like in my image example: by double clicking on red error row you will go to line that caused the error. This is a big improvements in productivity. Double-clicking on Output Console error information line places the editor position on error row

Hbide has a native syntax highlighter and you can source

open a list of function/procedure included in your

Intellisense
Hbide has implemented a high level of "intellisense" by way of tagging the functions prototypes. For intellisense action one more docking widget containing controls to execute required actions which can be activated via right-toolbar icon. + Rearranged icons on the right-toolbar as per logical distribution. The same scheme is applied in "View" menu. + Implemented one more panel in statusbar to show current theme. ! Simplified editor-tabs methods for more grandalurity. Hbide implements next level of intellisense . How it works: 1. Click on "ffn" icon on the right-toolbar or select

"Projects Functions Lookup" in "View" menu. 2. In the opened dock-widget, click on "Mark Projects" button. 3. On the top of widget, a list of all projects loaded will appear. 4. Click in the little check boxes left to the project titles. You can choose n number of combinations. 5. Click on "Re-Tag" button, if this is the first time you are tagging project(s), or "Load Tags" if you already have tagged before. 6. Keep a watch on right-corner of "Syntax" box, it will show the running commentary. 7. After a while the table above will be populated with function info: Name Type Line Project Source. 8. Type some alphabets in the top-most edit control. It will position the function matching the typed characters in the table. 9. Double-click on some function in the table, it will be opened in the editor. The "intellisense" part, above was basic mechanism to gather contents: 1. Type in the editor a function name which you think must have been in the exercise carried above. The moment you type "(" a nicely formatted tooltip, displying the prototype of this function will appear beneth the caret position. The prototype will remain there for 10 seconds ( finding a way how it can be controlled the way I want ). 2. Position editor caret somewhere in some function characters and activate context menu with right click. Select "Goto Function" option. It will open the underlying source with cursor positioned on the function proto. Simultaneously, the function will be made current in the table in "Projects Functions Lookup" widget. More is on the way, please forward shortcomings of above mechanism. NOTE: A point to cheer, this commit did not produce GPF at exit. ==== It is tested with mingw 4.4.0. However, MSVC 8.0 still generates.

Project Properties
Project Properties allow to set each element included in project: Sources include,Metadata,hbp, and compiler info Project Properties dialogs contents. + In project management. the .hbp has been Implemented: as project definition protocol. Exploited -3rd= token to keep Hbide specific data. You can open any existing .hbp and build it out of the box. You must have preset the build enviroment, OR make use of Hbide's .env protocol.

Relative paths
The relative paths are computed downwards and from .hbp location. Upper level paths still remain absolute. If your projects structure is well thought of, then this feature means this project tree is transferable across different OS's and drives. The relative paths work with search operations, while opening the files from Project Tree, and more , all in perfect syncronization.

+ Managed: .hbp filters on source level and are handelled transparently. In Project Tree source is shown without filters. Search operations are also transparent. So, an entry like: " {msvc|bcc}vouch/scandocument.prg" is respected by Hbide. It is now very simple to understand and manage. - The output executable is automatically recognized from linker output. So "Destination folder" is kept for only "Launch" option which, in fact, does not know where executable is located. "Build & Launch" and "Rebuild & Launch" options do not look for "Destination folder" at all. - Project location is always pulled from .hbp file. It is not retained anywhere to make the project portable.

Editor Theme Visual Theme can give a different look to the Hbide enviroment

Editing features
Split Windows
re-position editor tabs with drag. 1 Place mouse pointer over a tab -> 2 keep pressed left button -> 3 move mouse pointer left or right ->

( tab will move with your action ) -> 4 release left button when desired position is obtained. splitting any source into multiple windows. This feature allows you to edit different parts of same source simultaneously. This feature allows you to split window horizontally or vertically. You can split many times. This feature can be activated as follows: 1. Right-click somewhere in the editing tab 2. Context menu will be displayed, point to <Split> item

3. Select from "Split Horiz..." etc. Various actions on current editing window honoring splitted windows indivisually, i.e., Find/Replace, Goto, Function activated via Function List, etc., etc the behavior is as follows: Horizontal Split - Top row is columns are split Vertical Split - More rows are added at the bottom. Delete Splitted Window - Focus is always shifted to main edit window. i.e., parent of all. Hbide implements "Convert Single Quotes to Double" and its reverse, accessible from <Edit><Block...> main-menu options. First select the part of the source you want to apply these options, then click on relevant menu option. A toolbar implementation will be better which I am looking into how it can be presented in an aesthetic way

How to write Code Skeletons for easy reusable code


Code Skeleton

Click <Docks> main-menu option and select <Code Skeletons>. "Code Skeletons" window will open at the right-docking area. Close other docks if open to make room for its components. Click <Add New> button, a dialog will appear requesting a "Name". Enter recognizable name for this skeleton, i.e., "DO CASE 3", where "3" will represent that this case statement contains 3 iterations of CASE statement. It is just an example; adapt to your way of recognition. After you click <ok> the name will appear in "Identity" list-box. Start writing in "Code Snippet" editor, like: DO CASE CASE x == CASE x == CASE x == ENDCASE After you are done with it, click <Update>. Repeat the process for some other skeletons. Do not forget to click <Update> even after slightest modification. This will ensure that your skeleton is always in order. If you wish to change the name, click on that "Name" in "Identity" list-box and click <Rename>, follow next process. Click <Update> to save permanently. <Delete> is not working yet. Navigate the skeletons by clicking on the prompts; you will find the attached code in the editor below.

Special keyboard function...


Some interesting keyboard shortcuts: With F7 you can <Insert Separator> == "/*" + replicate( "-", 70 ) + "*/". Ctrl-D Duplicate current line Ctrl-W Close current tab

How to Call Code Skeletons


=========== While in the editor tab, position your editing cursor at desired column. Press Ctrl+K, a context menu will appear near left-upper part of the editing tab containing all skeletons you wrote. Use arrow-up/down keys to desired skeleton and press <Enter>. The code skeleton will be inserted in the source aligned to the column you started with. The cursor will be anchored on the same place. Alternativly you can use mouse, but keyboard navigation is simpler in this context. Note that alignment and indent of inserted code skeleton is perfect to starting column

Project Management: area enabled "Launch Parameters" which are supplied to the executable if "Launch..." is selected with build or otherwise. : supressed auto expansion of "Current Project" at startup. (Was a constant cause of annoyance if the project tree has been fairly large.)

! Code Skeletons: fixed to not append blank lines while called. : selection menu appears at the current cursor coordinates. Editor feature + Editor: double-click on some word place the selection in copy buffer in case that word is selected. This feature I always wished-for in xMate. + Editor: highly .prg code suited indentation engine. It comprises too many factors to explain. Please test. I feel you will be really happy. Also let me know what else can be implemented. I have a grasp of the code and it seems more ideas are already building up. Hbide displays last codec in the statusbar at the startup. Hbide support Formatting - <Replace Tabs with Spaces> <Remove Trailing Spaces> This can be achieved via Mainmenu <Edit><Format...> option. Find/Replace: Current selelcted text in "Find what:" control in selected state. Hbide <Line Move Up>, <Line Move Down> - Current Line If the line is already selected, selection is cleared.

Harbour Documentation Viewer - How to Invoke

Close any docking pane is visible at the right panel. Point to <Docks> option on <Main Menu> and click on <Document Viewer> A right-side "Document Viewer" window will appear. Provide Harbour's installation root path in "Harbour Installation Root:" field, i.e., C:\harbour OR alternatively, you can choose one by clicking

"Harbour Installation Root Path" icon on the right of field. Click "Refresh" icon on the toolbar of "Document Viewer" window only once and wait a couple of seconds. "Contents" tab will be populated with /doc and /doc/en folders. Double-click on one to expand - you will be able to view .txt file names. Double-click on some .txt node, wait a couple of seconds, and you will be able to see "functions" nodes. *Double-click on the function's node and you will be presented with html display in the "View" tab on the right. Navigate other tabs on the right, you will understand the contents. Next time Hbide will remember Harbour's installation root path. You can navigate in "See Also" slot. Functions contained in "See Also" are highlighted as a link where single-click presents the relevant document. You can printing of html document - activated via Print toolbar icon. You can also export as PDF document - activated via PDF toolbar icon. : syntax-highlighter for "Examples", "Tests" editors. : font Courier new set for "Examples", "Tests", "Arguments" editors. : Home, backward, forward, up navigation. : indexed search - activated via "Index" tab on left pane. : set to load whole tree at first invocation. : tree navigation simplified, honors single click. : added pages for Root, Paths, Files, nodes.

; Now usability of the Hbide's documentation viewer has increased many folds. I am wondering we have a lot of documentation in place but was invisible. Today I could feel comfortable and hope in coming future almost all of you will contribute for this noble cause. The "Generator/Writer" templates part. Goal is to provide very easy mechanism for a writer to select a source, the function(s) within that source, create basic template skeletons filled with meaningful material for selected functions, and slots to save them.

+ Implemented: auto activating and displaying the function's documentation you have currently finished typing opening brace. This feature is activated only when you have initialized the documentation browser by clicking on the "H" icon on the right toolbar. function-doc will only be activated if that is available in Harbour documentation tree. Also function's opening brace must be the last character of the function, no spaces inbetween.

oWnd := QMainWindow () => will not popup document in the viewer.

oWnd := QMainWindow() => will popup the document.

A function is recognized by opening brace only and the word preceeding will attempt to locate the function in Document Viewer Tree

; The search engine follows the standard way. * Click on "Index" left-pane tab, * Start typing in function edit box, * As you type, the incremental search is performed and relevant function is brought in focus. The search is case insensitive. * Press enter while in edit control and have function documentation visible in the viewer. * Alternatively you can navigate the Functions list, double-click on one yoy are interested in.

How to write documentation using the Documentation Writer?


1. Click on "Documentation Writer" icon on the right-toolbar, 2. Open some source in the editor, 3. Position cursor somewhere inside a function body, 4. Click on "Load from current function" icon on the top-toolbar of "Document Writer" widget, 5. Look at the contents, few fields will be auto filled with various info from current function, 6. Complete the other fields with relevent information, 7.1 Click on "Save the documentation with current function", .2 Look at the function body in the editor, The NANFORUM compliant documentation will be inserted at the top of function's prototype. 8.1 Click on "Save written/updated documentation" icon, and provide the filename to save on disk, .2 Copy such generated .txt in /harbour/doc/en, .3 Open "Harbour Document Viewer" and you should be viewing newly written documentation there. .4 Such generated file is ready to be uploaded to SVN, just send it to the list and group will decide if it needs something extra.

It is a quick way to generate help. You can keep the documentation in your sources or can create a tree like Harbour's. I know there is a lot more to be done in this tool, but at least group can start using it.

How to search inside your project or your directory


Find in files Hbide have a powerfull way of do find in project and files in dockable windows and with clickable result

! Find_Replace Dialog: set to find from begining if "Find What" is changed.

multiple-views of tabbed-editor. The term multiple-view allow present stacked tabs of common interest together switchable from "Editor" tree-presentation or from a combo-box containing such different "views". multiple views works: * Select "New..." from drop-down menu of "Views" combo-box in toolbar. * An input dialog opens, provide a useful name, keep it "one word" if possible * Press <ENTER> or click "Ok", a blank edit area will come-up. * Make ususal operations to add/delete/move sources. * You must be able to see view's name in the status-bar in blue. * Thus created "view" name will appear in the drop-down list. * To switch to another view, select it from same drop-down. * To verify, come out of the Hbide and re-enter. * Voila, you have the "views" created. * "Main" view or say "root" view is always present. Automaticallly Hbide restoring exact geometry of main window plus all the docking windows plus toolbars. Hbide creates idesettings.ini Hbide show number of selection characters in status-bar Hbide Implemented current line highliting. Currently it is ON by default. in future "Setup" dialog for different action .

Run Hbide, using the command line


Hbide can be invoked with either of the combination, .ini .hbp .prg .c .cpp. Following algorithm is followed: 1 .ini has the precedance over .hbp. 2 if both are passed then .hbp will be added to the project tree, after loading components from .ini. 3 if only .hbp is passed, then no attempt is made to save the settings. 4 if only sources are passed then all will be opened "Main" panel, which will also be the startup panel, no project tree will be displayed.

How define keyboard mapping?


In setup you can open keyboard mapping that allow have a redefinition of all keyboard mapping and will also be defined new macros in follow example I create an integration for using xharbour language reference guide with harbour

How define other tool In setup menu

How works column mode...?


This is much-awaited and extremely-required feature - block copy/paste. This implementation closely follows xMate's footsteps and is highly optimized, having maximum tasks carried through .prg code. Probably this opens up. Hbide to wider audience. This has been the most difficult feature so far,and has consumed an entire week with intensive schedule. Here is how it should be used: Activation: Clicking on the "Toggle Selection Mode" top-toolbar icon. It must appear depressed after activation. Selection Process: Keyboard : Shift + Navigation Keys ( Left, Right, Up, down, PgUp, PgDn, Home, End ). Mouse : Mouse-move while left-button pressed ( Only available for visible text ). Copy : Ctrl+C ( text is also available on the clip-board ) Paste : Ctrl+V ( text only copied through Ctrl+C while in "Column Selection" mode ). Inserts : Position cursor at first line and column, Press Shift+Down arraow upto some ending row, A thin-vertical-line should appear follwoing your cursor path, Start typing any characters, Any other navigation key will end this sesion,

Backspace key can be used to deleted previous characters. If block is already selected, visible through color differentiation, typing any charcter(s) will merely fill the selection with it, Deletes : Select the text with Shift+Navigation Keys, Press "Del". It is highly possible that some of the artifacts may have gone not exactly like xMate, so please report back. Also note that selections left-to-right are known for accuracy, right-to-left may not produce accurate results. Other thing to note is that horizontal scrolling has not been possible, so if your text goes beyond right-edge of the window and you have a need to copy it, then first zoom-in to brought it into viewport, then start selection process. Vertical length does not matter. However with mouse you can only select a window-full of text. xMate does not support column-selection with mouse.

How the "Tools & Utilities" option works It can be invoked via a new top-toolbar icon with two components, 1) Click the icon itself to define a tool, 2) Select from icon's drop-down list to execute. The execution is also available from within its interface <Execute> button. ! Reworked: "Panels" interface. Now it is a toolbar icon with drop-down menu. This interface is much-more elegant and effective in operations. + Implemented: auto-saving a source in the background. Legend: after every minute the contents of the source are inspected, if the source is modified, it is saved with ".tmp" extension concating after its original name. c:\x\my.prg => c:\x\my.prg.tmp if application exits normally, theis temp file is deleted, the same is done with every "SAve" invocation. if at next run, this file is detected, it is asked to replace the original one. + Introduced: again, the animated controls, i.e., gradients on the menus, toolbars, etc, but are controlled via "Toggle Animation" option in the "View" sub-menu of main menu. This implementation is not made persistent, need to hera from you. ! Removed: "Always_On_Top" flag of Harbour Splash Screen. It was causing that in case of startup error, or info rendering, user was unable to view the same. . Back to the pavilion, after a tiring outing. So I could not compile all the changes I did before leaving, so please be patient if something goes weired. + Implemented: interface to find next/previous occurance of selected text in the current editing instance. The moment some text is selected in the editor, two tool-buttons will automatically show-up on the lower-right corner of the editing window to facilitate you execute "find" operation for selected text up or down. Buttons will disappear where there is no more selected text.

single source build and compile


to build a source, current defined environment is used and build process stays in the folder where source resides. Also source is not saved. Hbide attempts to executable it also. Action defines a new icon on the top-toolbar and also an entry into the "Build" menu. hbmk2 speedtst.prg so is possible A single PRG to EXE without PROJECT DFINITION. Imagine you want simply to run a .prg from harbour/tests. It was not possible before last commit. Now you open that PRG in Hbide and click "Build Single Source" and there you go. As all examples in harbout/tests only include headers from harbour/ include, there are build fine. But if another header is used to test quicky an example send on the list, it is not possible.

+ Extended: in addition to next/previous buttons to naviagte occurances of selected text, three more buttons are added: "first", "last", occurance and "highlight all" occurances. + Implemented: macros parsing in "Parameters" list of "Tools and Utilities" protocol. Currently following macros are parsed: {source_fullname} => full sourcename of current edit instance {source_name} => mere name of current edit instance {source_path} => only path of source in current edit instance {%MY_ENV_VAR%} => result of hb_GetEnv( "MY_ENV_VAR" ) C:\temp\mycopy.bat {source_fullname} {source_path}\mysource.bkp => C:\temp\mycopy.bat C:\harbour\contrib\Hbide\Hbide.prg C:\harbour\contrib\Hbide\mysource.bkp ( assuming that current editor is containe Hbide.prg ) macro notation for "Tools and Utilities" to confirm to hbMK2 standards. {source_fullname} => ${source_fullname} {source_name} => ${source_name} {source_path} => ${source_path} => ${source_ext} [Added] {%MY_ENV_VAR%} => ${MY_ENV_VAR}

How can manage dbf like dbu?


In view menu you can find idedbu option where you can set index, locate

you can also modify the structure of database

Which components are used by Hbide...?


Hbide is based on follow library: hbxbp & hbqt The hbxbp library allow you work on windows,linux,mac os hbxbp implement a complete class compatible with xbase++ part hbxbp seems more "Clipper like" than other libs and it could be Visual Harbour I suggest you start with C:\harbour\contrib\hbxbp\tests hbmk2 demoxbp.prg another intresting application made with xhb is Hbide Is it is good but experimental stage but you can understand the power Hbide is project manager and builder,

How convert project file from xmate,hbmake,xpbuild ?


1) Download Hbide and hbmk2 v2.1 or compile from cvs 2)convert from hbmake,xmate,xpbuild xhp to hbp ( hbmake to hbp) hbmk2 test.bc -hbmake=test.hbp (xmate to hbp) hbmk2 test.hbp -xhp=test.xhp (xbpuild to hbp)

hbmk2 test.hbp -hbmake=test.hbp i suggest analyse resultcommand line of hbmk2 -help to undestrand what is test.hbp is a collect of command line each command contained in command line of "hbmk2 -help" may be used as row in hbp ...... xhp=<file> convert .xhp (xMate) project file to .hbp file -hbmake=<file> convert hbmake project file to .hbp file -xbp=<file> convert .xbp (xbuild) project file to .hbp file .....

3) open with notepad hbp project created in prev step add follow row if you use xharbour -3rd=Hbide_xhb=YES add follow row if yoy use xbase++ -3rd=Hbide_xpp=YES add follow row if yoy use clipper -3rd=Hbide_clp=YES 4) addlib missing from your env that nor are standard like with -l and name of lib or better refer to hbc is present -lfivehx -lFivehc. -lhbzip.lib -lct.lib 5) add your harbour flag in test.hbp

How use report?


The view menu contain hbreportmanager that allow create a file with hqr extension

- fs s) add your harbour flag in test.hbp

ideDBU - External RDDs - How to - Implementation


(pritpal post) Hello Everybody Below is the script which can either be linked with your local copy of Hbide or can be told to Hbide to run at startup as a script. It facilitates n number of RDDs which can be hooked into Hbide's DBU. I will explain all parts one-by-one, at first have a glance: / *---------------------------------------------------------------------*/ // // script TO handle rdd call from Hbide // / *---------------------------------------------------------------------*/ #include "common.ch"

#include "hbtrace.ch" / *---------------------------------------------------------------------*/ REQUEST CACHERDD / *---------------------------------------------------------------------*/ STATIC aConxns := {} STATIC aConxnNos := {} / *---------------------------------------------------------------------*/ FUNCTION script_rdds() RETURN { "CACHERDD", "ADS" } / *---------------------------------------------------------------------*/ FUNCTION script_initialize() LOCAL cConxn, a_ LOCAL cUser := "abcdefg" LOCAL cPass := "xyz" IF empty( aConxns ) aadd( aConxns, "Ecp 1 94;10.0.0.94;1972;AR;" ) aadd( aConxns, "Ecp 2 95;10.0.0.95;1972;AR;" ) aadd( aConxns, "Cluster 98;10.0.0.98;1972;AR;" ) aadd( aConxns, "Development;10.0.0.123;1972;AR;" ) aConxnNos := array( len( aConxns ) ) FOR EACH cConxn IN aConxns a_:= hb_atokens( cConxn, ";" ) CacheSetServerParams( a_[ 2 ], val( a_[ 3 ] ), cUser, cPass, 20 ) aConxnNos[ cConxn:__enumIndex() ] := CacheAddConnectionEx( a_[ 2 ], val( a_[ 3 ] ), cUser, cPass, 20, a_[ 4 ] ) NEXT REQUEST ADS /* Initialize ADS */ // RddSetDefault( "ADS" ) AdsSetFileType( 2 ) // DBFCDX AdsSetServerType( 2 ) // Remote AdsLocking( .T. ) ENDIF

RETURN aConxns / *---------------------------------------------------------------------*/ FUNCTION script_connections( cDriver ) script_initialize() IF cDriver == "CACHERDD" RETURN aConxns ENDIF RETURN {} / *---------------------------------------------------------------------*/ FUNCTION script_tableExists( cTable, cDriver, cConxn ) LOCAL nConxn, n script_initialize() IF cDriver == "CACHERDD" IF ( n := ascan( aConxns, {|e| e = cConxn } ) ) > 0 IF ! empty( nConxn := aConxnNos[ n ] ) RETURN CacheExistTable( cTable, nConxn ) ENDIF ENDIF ELSEIF cDriver == "ADS" RETURN hb_fileExists( cTable ) ENDIF RETURN .f. / *---------------------------------------------------------------------*/ FUNCTION script_tableUse( cTable, cAlias, cDriver, cConxn ) LOCAL nConxn, n HB_SYMBOL_UNUSED( cAlias ) script_initialize() IF cDriver == "CACHERDD" IF ( n := ascan( aConxns, {|e| e = cConxn } ) ) > 0 IF ! empty( nConxn := aConxnNos[ n ] ) CacheSetConnection( nConxn ) USE ( cTable ) NEW SHARED VIA ( cDriver ) RETURN NetErr() ENDIF

ENDIF ELSEIF cDriver == "ADS" IF empty( cAlias ) USE ( cTable ) NEW SHARED VIA ( cDriver ) ELSE USE ( cTable ) ALIAS ( cAlias ) NEW SHARED VIA ( cDriver ) ENDIF RETURN NetErr() ENDIF RETURN .f. / *---------------------------------------------------------------------*/ FUNCTION script_tableSelect( cDriver, cConxn ) LOCAL nConxn, cTable := "", n LOCAL cDatabasePath := "_path_to_my_tables" script_initialize() IF cDriver == "CACHERDD" IF ( n := ascan( aConxns, {|e| e = cConxn } ) ) > 0 IF ! empty( nConxn := aConxnNos[ n ] ) CacheSetConnection( nConxn ) cTable := GetATable( aConxns[ n ] ) ENDIF ENDIF ELSEIF cDriver == "ADS" cTable := Hbide_fetchAFile( , "Select a Table", { { "Database File", "*.dbf" } }, cDatabasePath ) ENDIF RETURN cTable / *---------------------------------------------------------------------*/ STATIC FUNCTION GetATable( cConxn ) LOCAL qStrList, cTable LOCAL aTables := CacheGetTables() IF ! empty( aTables ) qStrList := QStringList():new() FOR EACH cTable IN aTables qStrList:append( cTable ) NEXT cTable := QInputDialog():getItem( Hbide_setIDE():oDlg:oWidget, cConxn, "Table ?", qStrList ) ENDIF RETURN cTable

/ *---------------------------------------------------------------------*/

With above code, I have linked RDDADS and CacheRDD for Hbide in-use at our company. Hbide calls above set of functions at different stages just like AChoice() calls UDF at many levels. Each function triggers a specific action, belong to RDD in question or adding a component/part in the Hbide user interface. I think functions are self descriptive and you must be gathering their meaning. Still I explain in brief what they actually intend: script_rdds() script_initialize() script_connections( cDriver ) script_tableExists( cTable, cDriver, cConxn ) script_tableUse( cTable, cAlias, cDriver, cConxn ) script_tableSelect( cDriver, cConxn ) script_rdds() Called when DBU is invoked first time. Function returns the list of RDDs which are appended to list of existing RDDs. script_initialize() Is invoked if rdds() sends positive response. Its sole purpose is to set the connections right. script_connections( cDriver ) Depending on the driver, script returns an array of connections which are the displayed in the next drop-down combobox when this RDD is selected. The selected connection is made current and ready for selection of tables, use, etc. script_tableExists( cTable, cDriver, cConxn ) The function is queries to establish if table exists or not. This is because DBU session is stored in Hbide.ini and next run attempts to open last opened tables from same connections. script_tableUse( cTable, cAlias, cDriver, cConxn ) The function is called to let the RDD open ( USE ) a given table. It returns success or failure and only on success Hbide's user interface creates a browser object. script_tableSelect( cDriver, cConxn ) The function is called to get a table selected from a given connection. This is invoked via "Open" icon on the DBU's top-toolbar.

Because you need to link required libs to Hbide, so I never published it before. I was trying to find how this can be done from outside of linking Hbide locally. You will be in a better position to forward a solution. But till then you can copy/paste above code, link RDDADS libraries and open tables in Hbide. Pritpal Bedi

How to compile from source...?


cd C:\harbour\contrib\Hbide hbmk2 Hbide.hbp -rebuild You need harbour source and last qt version Whith standard Qt in dynamic mode for qt license reason, before start Hbide you must include path path "c:\Qt\4.5.3\bin;" to path environment. F.e. in start.bat : path=c:\Qt\4.5.3\bin;%path% Hbide.exe

Which Future...?
Hbide's interface is not yet final. It may change in the coming future. Many things are evolving. After final layout, when is approved by the group, will be write proper documentationhnode is under preparation allow extended book-"Mark" feature. handle extended syntax highlighting hbIDE's growth can be summarized as:

what it is today, what is proposed, what is on todo list, its strengths, and pitfalls

What it is today Implements: multiple projects edit,compile,link cycles with multiple compilers from within single instance.

Implements: tracking the compile/link errors and opening the source containing thus error in the editor with offending line under cursor. Implements: multiple editing sessions within a single instance with easy navigation and cut/copy/paste portability amongst them. Implements: high-performance edit instances with a bunch of features, such as, intelligent autoindentation; in-build keyword capitalization (.prg); ability to switch on/off line-number display; selected block operations: left-right indentation, single-line comments, multi-line comments, double to single quotes, single to double quotes; case conversions: lower to upper, upper to lower, invert cases; line operations: duplicating a line, deletion of line, moving lined in either direction - up/down; and many more. Implements: splitting one edit instance into multiple horizontal and/or vertical windows to edit different parts of the same source simultaneously. Implements: auto-disaster-recovery for every editing instance per minute interval ensuring the maximum amount of loss confined to a minute's work only. Implements: code-skeleton definition and rendering to next levels with user-defined macros and variables in addition to hbIDE defined macros. Implements: tagging of functions prototypes for next levels of function lookups and other "intellisense" features for multiple projects simultaneously. Implements: a reasonable level of "intellisense" providing code-completion lists, on-the-spot function prototype tips, full-blown function overlook, and more. Implements: a powerful "Find-in-files" feature accepting currently-opened edits, contained projects, folders on the disk including sub-folders, options for plain-text or regular expression search, and finally opening the source with currently clicked search-text highlighted in the editor. Implements: a unique "Document Viewer" which pulls the NANFORUM documentation format compliant .txt files from a "root folder" and tree and presents the contents in a navigable browser with options to "Print", "Save as .pdf", and more. Implements: a unique way to write documentation for functions contained in the editing sessions with options to insert the same into the source at appropriate place or save as a NANFORUM documentation format compliant .txt file on disk which, in-turn, is fully compliant to be viewed in "Document Viewer" if opted as such. Implements: out-of-the-box syntax highlighting for .prg, .c, .cpp, .ch, .h, sources with a provision to set the highlighting themes in the hands of the user as per needs and offering a bunch of pre-defined themes plus interface to inject your own. Implements: intelligent "book-marks" with visual elements to define, locate and destroy - with least efforts - almost hassle free. Implements: to be used as simple text-editor, a project maintainer and/or builder, or both. Implements: "Tools & Utilities" features which extends hbIDE to take use of any other program, including the DOS prompt, to be executed with parameters from within hbIDE and in a detached manner. Probably it will be wise to extend it to accept parameters comprised of properties of hbIDE components, such as, source file name on disk opened in current editor instance. Implements: saving the current state of hbIDE when exited normally and restores the exact same

environment at next run, including the editors state per cursor position, the size and position of the main frame, and lot more. Implements: an interface to define short-cut macros just like xMate plus including some extended functionality. Implements: three types of selection modes: 1. Stream Selection 2. Column Selection 3. Line Selection. All type of blocks are persistent across files. Stream selection mode is a standard text selection protocol implemented by every text editor in the world. Column selection has some peculiar application and Line selection mode offer yet another functionality. All types offer standard cut/copy/paste behavior. Paste operation honors the selection mode, f.e., a block selected under column mode will be pasted as column block. Line blocks overwrite the exiting lines if pasted. Implemented: a simple yet powerful interface to hook third-party plugins designating it truely extensible. Implements: integration with Visual Source Safe ( VSS ), version control system. What is proposed Visual debugger - someone has to jump in as I know a little about debuggers and their behavior Form editor - which is out of question until we have a complete GUI framework in place. Object browser - what is this ? Version control (SVN) integration - should be easy; need to explore the command-line commands. What is on todo list Wizard based project creation for different compilers - xHarbour, Clipper, Xbase++, Flagship, Clip; for multiple C compilers. Strengths An out-of-the-box experience for Xbase dialect programmers without the hassles of writing tough scripts to achieve high levels of productivity. An all-in-one, composite-components oriented, highly desktop real-estate conscious interface leveraging the levels of productivity to highest extent. With a programmer-oriented approach shedding any inclination of commercial orientation. With highest possibilities to be extended by anyone who does not have any interaction with C language. Pitfalls High memory-intensive back-bone.

Potrebbero piacerti anche