/*----------------------------------------------------------------------------
 RMC4XHB.PRG - Rmchart function calls for xHb use with Rmchart.dll
               Based on BCX code for Rmchart by Michael Henning  - Rmchbcx.inc

 Link Rmchart.lib and this prg into your app. (But see readme.txt first!!!)

 In your main prg startup, activate the DLL with...
    
     LOCAL hRmcLib := 0    //  (be sure to #include "Rmchart.ch" at top of prg)

     hRmcLib  := LoadLib32( "Rmchart.dll" )

     SetHandle(hRmcLib)  // to send the handle from main prg to this prg.

 Then in your exit proc, unload it with...

     FreeLib32( hRmcLib )

 Remember to distribute Rmchart.DLL with your app.

 IMPORTANT PROGRAMMING WARNING:

 Some Rmchart functions require passing in parameters that are data type
 DOUBLE - which means numbers with a decimal point. When passing these
 parameters, you MUST use a decimal point in the number or the app will GPF.
 Here is why... Whereas with FiveWin's DLL32, you have to indicate the 
 C datatypes of each parameter, you don't with xHarbour's DLLCALL() function.  
 That is because the C program underlying DLLCALL() analyzes the data being
 passed to it in the parameters and from what it sees, it decides what the
 parameter's datatype is. DLLCALL() was apparently designed this way to save
 programmers from the work of having to specify the C datatypes of parameters.

 So if the parameter contains the number 100 then DLLCALL() says, "Aha, this 
 is a C type LONG," (numbers without a decimal) and then sends it to the DLL 
 as such.  But if the DLL is actually expecting a DOUBLE, like 100.00 , then 
 it will have a fit and GPF. But if the data going to the DLL's DOUBLE receptor
 is passed as 100.00 , then DLLCALL() looks at it and says, "Here comes another
 DOUBLE," and passes it through as such, which keeps the DLL humming along 
 nicely.

 In the function listings below, any DOUBLE parameters are noted.

//----------------------------------------------------------------------------
*/
STATIC hRmcDll

#include "DLLxHb.ch"
#include "cstruct.ch"
#include "wintypes.ch"
#include "Rmchart.ch"


pragma pack(4) 

/*
   When using xHarbour DLLCALL() instead of FWH DLL32, the standard elements
   of this call consist of: 

   nRt := DLLCall(    -  xHb function (returns numeric result, usually 0)
      hRmcDll,        -  handle of DLL to call
      DC_CALL_STD,    -  xHb calling convention (defined at top of this prg)

   This is cumbersome, so DLLxHb.ch takes care of this for us so that we
   can use the same convenient syntax in our apps as for FWH's DLL32.
*/

// This file includes all of the Rmchart function calls via xHb's DLLCALL.

  // This func used by app's Main() to send the Rmchart.dll handle here...
FUNCTION SETHandle(hRmc)
  hRmcDll := hRmc
RETURN nil

// RmChart.dll Functions...
/*  // An example of Henning's original BCX code from RMChartBCX.inc ....
DECLARE FUNCTION RMC_ADDBARSERIES LIB "RMCHART.DLL" ( _
                 nCtrlId AS LONG, _
                 nRegion AS LONG, _
                 @nFirstDataValue AS DOUBLE PTR, _
                 nDataValuesCount AS LONG, _                                          
                 nType  AS LONG, _ 
                 nStyle AS LONG, _ 
                 nIsLucent AS LONG, _
                 nColor AS LONG, _
                 nIsHorizontal AS LONG, _
                 nWhichDataAxis AS LONG, _
                 nValueLabelOn AS LONG, _
                 nPointsPerColumn AS LONG, _
                 nHatchMode AS LONG _
                 ) AS LONG       
*/

// The above BSC function translated by Seiler to this xHb code...

// (Note: function calls are case-sensitive, and for this DLL
//        they must be all-caps HERE or else they won't work. But in your
//        prg, you CAN use upper & lower cas when calling this command.
DLLxHb FUNCTION RMC_ADDBARSERIES(  ;         // RMC_AddBarSeries 
                 nCtrlId             , ;
                 nRegion             , ;
                 @nFirstDataValue    , ;
                 nDataValuesCount    , ;
                 nType               , ;
                 nStyle              , ;
                 nIsLucent           , ;
                 nColor              , ;
                 nIsHorizontal       , ;
                 nWhichDataAxis      , ;
                 nValueLabelOn       , ;
                 nPointsPerColumn    , ;
                 nHatchMode ) LIB hRmcDll // This handle passed to this prg
                                          // by func SETHandle() above, called
                                          // from the the app's main prg.

DLLxHb FUNCTION RMC_ADDCAPTION( ;            // RMC_AddCaption
                 nCtrlID, ;
                 nRegion, ; 
                 sCaption, ;
                 nTitelBackColor, ;
                 nTitelTextColor, ;
                 nTitelFontSize, ;
                 nTitelIsBold ;
                 ) LIB hRmcDll 

  // Ignore any functions having names ending with "I" - they don't work yet in
  // xHarbour, but in every case there's an equivalent function without "I".
DLLxHb FUNCTION RMC_ADDCAPTIONI( ;   // RMC_AddCaptionI
                 nCtrlID, ;
                 nRegion, ;
                 @oCaption ;            // tRMC_CAPTION PTR
                 ) LIB hRmcDll

/*
// Here's the original function from the BSX version, RMCHBCX.INC...
DECLARE FUNCTION RMC_AddDataAxis LIB "RMCHART.DLL" ( _
                 nCtrlID AS LONG, _
                 nRegion AS LONG, _
                 nAlignment AS LONG, _
                 nMinValue AS DOUBLE, _
                 nMaxValue AS DOUBLE, _
                 nTickCount AS LONG, _
                 nFontsize AS LONG, _
                 nTextColor AS LONG, _
                 nLineColor AS LONG, _
                 nLineStyle AS LONG, _
                 nNoDecimalPoint AS LONG, _
                 sUnit AS LPSTR, _
                 sText AS LPSTR, _
                 sLabels AS LPSTR, _
	         nLabelAlignment AS LONG _	
                 ) AS LONG
*/

// Here's the xHb version...
DLLxHb FUNCTION RMC_ADDDATAAXIS( ;           // RMC_AddDataAxis
                 nCtrlID, ;
                 nRegion, ;
                 nAlignment, ;
                 nMinValue, ;   // DOUBLE - must be like 0.0 with decimal or will crash!
                 nMaxValue, ;   // DOUBLE - must be like 100.0 with decimal
                 nTickCount, ;
                 nFontsize, ;
                 nTextColor, ;
                 nLineColor, ;
                 nLineStyle, ;
                 nNoDecimalPoint, ;
                 sUnit, ;
                 sText, ;
                 sLabels, ;
		 nLabelAlignment ;	
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDGRID( ;               // RMC_AddGrid
                 nCtrlID, ;
                 nRegion, ;
                 nBackColor, ;
                 nAsGradient, ;
                 nLeft, ;
                 nTop, ;
                 nWidth, ;
                 nHeight, ;
                 nBiColor ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDGRIDLESSSERIES( ;     // RMC_AddGridlessSeries
                 nCtrlID, ;                                       
                 nRegion, ;
                 @nFirstDataValue, ;   // DOUBLE - must be like 0.0
                 nDataValuesCount, ;                  
                 @nFirstColorElement, ;  
                 nColorElementsCount, ;
                 nStyle , ;         
                 nPieAlignment , ;         
                 nExplodemode, ; 
                 nIsLucent, ;
                 nValueLabelOn, ;
                 nHatchMode, ;
                 nStartAngle ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDHIGHLOWSERIES( ;      // RMC_AddHighLowSeries
                 nCtrlID, ;                      
                 nRegion, ;
                 @nFirstDataValue, ;  // DOUBLE - must be like 0.0 
                 nDataValuesCount, ;                  
                 @nFirstPPCValue, ;   
                 nPPCValuesCount, ;
                 nStyle, ;
                 nWhichDataAxis, ;
                 nColorLow, ;
                 nColorHigh ;                 
                 ) LIB hRmcDll 
                          
DLLxHb FUNCTION RMC_ADDLABELAXIS( ;          // RMC_AddLabelAxis
                 nCtrlID, ;
                 nRegion, ;
                 sLabel, ;     
                 nCount, ;
                 nTickCount, ;
                 nAlignment, ;
                 nFontsize, ;
                 nTextColor, ;
                 nTextAlignment, ;
                 nLineColor, ;
                 nLineStyle, ;
                 sText ;                 
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDLEGEND( ;             // RMC_AddLegend
                 nCtrlID, ;
                 nRegion, ;
                 sLegendText, ;    
                 nLegendAlign, ;
                 nLegendBackColor, ;
                 nLegendStyle, ;                 
                 nLegendTextColor, ;
                 nLegendFontSize, ;
                 nLegendIsBold ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDLINESERIES( ;         // RMC_AddLineSeries
                 nCtrlID, ;                      
                 nRegion, ;
                 @nFirstDataValue, ;  // DOUBLE - must be like 0.0 
                 nDataValuesCount, ;
                 @nFirstPPCValue, ;    
                 nPPCValuesCount, ;
                 nChartType , ;         
                 nStyle, ; 
                 nLineStyle, ; 
                 nIsLucent, ;
                 nColor, ;                          
                 nChartSymbol, ;    
                 nWhichDataAxis, ;
                 nValueLabelOn, ;
                 nHatchMode ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDREGION( ;             // RMC_AddRegion
                 nCtrlID, ;
                 nLeft, ;
                 nTop , ;
                 nWidth, ;
                 nHeight, ;
                 sFooter, ;
                 nShowBorder ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDREGIONI( ;
                 nCtrlID, ; 
                 @oRegion ;
                 ) LIB hRmcDll

DLLxHb FUNCTION RMC_ADDTOOLTIPS( ;   // RMC_AddToolTips
                 nCtrlID, ;
                 hWnd, ;
                 nToolTipWidth ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDVOLUMEBARSERIES( ;    // RMC_AddVolumeBarSeries
                 nCtrlID, ;                      
                 nRegion, ;
                 @nFirstDataValue, ;  // DOUBLE - must be like 0.0 
                 nDataValuesCount, ;
                 @nFirstPPCValue, ;   
                 nPPCValuesCount, ;
                 nColor, ;
                 nWhichDataAxis ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDXAXIS( ;              // RMC_AddXAxis
                    nCtrlID, ;
                    nRegion, ;
                    nAlignment, ;
                    nMinValue, ;   // DOUBLE - must be like 0.0 
                    nMaxValue, ;   // DOUBLE - must be like 100.0 
                    nTickCount, ;
                    nFontsize, ;
                    nTextColor, ;
                    nLineColor, ;
                    nLineStyle, ;
                    nNoDecimalPoint, ;
                    sUnit     , ;
                    sText, ;
                    sLabels, ;
                    nLabelAlignment ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDYAXIS( ;              // RMC_AddYAxis
                    nCtrlID, ;
                    nRegion, ;
                    nAlignment, ;
                    nMinValue, ;   // DOUBLE - must be like 0.0 
                    nMaxValue, ;   // DOUBLE - must be like 100.0 
                    nTickCount, ;
                    nFontsize, ;
                    nTextColor, ;
                    nLineColor, ;
                    nLineStyle, ;
                    nNoDecimalPoint, ;
                    sUnit     , ;
                    sText, ;
                    sLabels, ;
                    nLabelAlignment ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ADDXYSERIES( ;           // RMC_AddXYSeries
                 nCtrlID, ;                      
                 nRegion, ;
                 @nFirstXDataValue, ;  // DOUBLE - must be like 0.0 
                 nDataXValuesCount, ;                 
                 @nFirstYDataValue, ;  // DOUBLE - must be like 0.0 
                 nDataYValuesCount, ;                  
                 nColor, ;                          
                 nStyle, ; 
                 nLineStyle, ; 
                 nSymbolStyle, ;    
                 nWhichXAxis, ; 
                 nWhichYAxis, ; 
                 nValueLabelOn ;
                 ) LIB hRmcDll 

/*
// Here is the original BSX code for RMC_CalcAverage from RMCHBSX.INC...
DECLARE FUNCTION RMC_CalcAverage LIB "RMCHART.DLL" ( _
                   nCtrlId AS LONG, _
                   nRegion AS LONG, _
                   nSeriesIndex AS LONG, _                   
                   nAverage AS DOUBLE PTR, _
                   nXStart AS LONG PTR, _
                   nYStart AS LONG PTR, _
                   nXEnd AS LONG PTR, _
                   nYEnd AS LONG PTR, _
                   sHighLowIndex AS LPSTR _
                   ) AS LONG

*/
// Here is the xHb version...
DLLxHb FUNCTION RMC_CALCAVERAGE( ;           // RMC_CalcAverage
                   nCtrlId, ;
                   nRegion, ;
                   nSeriesIndex, ;                   
                   @nAverage, ;   // DOUBLE - must be like 0.0
                   @nXStart, ;
                   @nYStart, ;
                   @nXEnd, ;  
                   @nYEnd, ;  
                   @sHighLowIndex ;
                   ) LIB hRmcDll 

DLLxHb FUNCTION RMC_CALCTREND( ;             // RMC_CalcTrend
                   nCtrlId, ;
                   nRegion, ;
                   nSeriesIndex, ;                   
                   @nFirstValue, ;  // DOUBLE - must be like 0.0
                   @nLastValue, ;   // DOUBLE - must be like 0.0 
                   @nXStart, ;     
                   @nYStart, ;    
                   @nXEnd, ;       
                   @nYEnd, ;       
                   sHighLowIndex ;
                   ) LIB hRmcDll 
                   
DLLxHb FUNCTION RMC_COBOX( ;                 // RMC_COBox
                    nCtrlID, ;
                    nCOIndex, ;
                    nLeft, ;
                    nTop, ;
                    nWidth, ;
                    nHeight, ;
                    nStyle, ;
                    nBGColor, ;
                    nLineColor, ;
                    nTransparency ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_COCIRCLE( ;              // RMC_COCircle
                    nCtrlID, ;
                    nCOIndex, ;
                    nXCenter, ;
                    nYCenter, ;
                    nWidth, ;
                    nStyle, ;
                    nBGColor, ;
                    nLineColor, ;
                    nTransparency ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_CODASH( ;                // RMC_CODash
                    nCtrlId, ;
                    nCOIndex, ;
                    nXStart, ;
                    nYStart, ;
                    nXEnd, ;
                    nYEnd, ;
                    nStyle, ;
                    nColor, ;
                    nAsSpline, ;
                    nLineWidth, ;
                    nStartCap, ;
                    nEndCap ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_CODELETE( ;              // RMC_CODelete
                    nCtrlId, ;
                    nIndex ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_COGETTEXTWH( ;           // RMC_COGetTextWH
                    nCtrlID, ;
                    nIndex, ;
               	    @nWH ;     
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_COIMAGE( ;               // RMC_COImage
                    nCtrlID, ;
                    nCOIndex, ;
                    sImagePath, ;
                    nLeft, ;
                    nTop, ;
                    nWidth, ;
                    nHeight ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_COLINE( ;                // RMC_COLine
                    nCtrlId, ;
                    nCOIndex, ;
                    @nXPoints, ;    
                    @nYPoints, ;     
                    nPointsCount, ;                         
                    nStyle, ;
                    nColor, ;
                    nAsSpline, ;
                    nLineWidth, ;
                    nStartCap, ;
                    nEndCap ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_COPOLYGON( ;             // RMC_COPolygon
                    nCtrlId, ;
                    nCOIndex, ;
                    @nXPoints, ;     
                    @nYPoints, ;     
                    nPointsCount, ;                         
                    nBGColor, ;
                    nLineColor, ;
                    nAsSpline, ;                    
                    nTransparency ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_COSYMBOL( ;              // RMC_COSymbol
                    nCtrlID, ;
                    nCOIndex, ;
                    nXCenter, ;
                    nYCenter, ;
                    nStyle, ;
                    nColor ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_COTEXT( ;                // RMC_COText
                    nCtrlID, ;
                    nCOIndex, ;
                    sText, ;
                    nLeft, ;
                    nTop, ;
                    nWidth, ;
                    nHeight, ;
                    nStyle, ;
                    nBGColor, ;
                    nLineColor, ;
                    nTransparency, ;
                    nLineAlignment, ;
                    nTextColor, ;
                    sTextProperties ;
                    ) LIB hRmcDll 
                    
DLLxHb FUNCTION RMC_COVISIBLE( ;             // RMC_COVisible
                    nCtrlId, ;
                    nIndex, ;
                    Hide ;
                    ) LIB hRmcDll 

DLLxHb FUNCTION RMC_CREATECHART( ;           // RMC_CreateChart
                 nParentHndl, ;     // hWnd
                 nCtrlId, ;
                 nX, ;
                 nY, ;
                 nWidth, ;
                 nHeight, ;
                 nBackColor, ;
                 nCtrlStyle, ;
                 nExportOnly, ;
                 sBgImage, ;
                 sFontName, ;
                 nToolTipWidth, ;
                 nBitmapBKColor ;
                 )  LIB hRmcDll 

DLLxHb FUNCTION RMC_CREATECHARTI(;
                 nParentHndl, ;
                 nCtrlID, ;
                 @oChart ;
                 ) LIB hRmcDll

DLLxHb FUNCTION RMC_CREATECHARTFROMFILE( ;   // RMC_CreateChartFromFile
                 nParentHndl, ;     // hWnd
                 nCtrlId, ;
                 nX, ;
                 nY, ;
                 nExportOnly, ;
                 sRMCFile ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_CREATECHARTONDC( ;       // RMC_CreateChartOnDC
                 nParentDC, ;
                 nCtrlId, ;
                 nX, ;
                 nY, ;
                 nWidth, ;
                 nHeight, ;
                 nBackColor, ;
                 nCtrlStyle, ;
                 nExportOnly, ;                 
                 sBgImage, ;
                 sFontName, ;                 
                 nBitmapBKColor ;
                 )  LIB hRmcDll 

DLLxHb FUNCTION RMC_CREATECHARTFROMFILEONDC(; // RMC_CreateChartFromFileOnDC
                 nParentDC, ;
                 nCtrlId, ;
                 nX, ;
                 nY, ;
                 nExportOnly, ;
                 sRMCFile ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_DELETECHART( ;           // RMC_DeleteChart
                 nCtrlID ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_DRAW( ;                  // RMC_Draw
                 nCtrlID ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_DRAW2CLIPBOARD( ;        // RMC_Draw2Clipboard
                 nCtrlID, ;
                 nType ;
                 ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_DRAW2FILE( ;             // RMC_Draw2File
                 nCtrlID, ;
                 sFileName, ;
                 nWidth, ;
                 nHeight, ;
                 nJPGQualityLevel ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_DRAW2PRINTER( ;          // RMC_Draw2Printer
                 nCtrlID, ;
                 nPrinterDC, ;  // AS HDC
                 nLeft, ;
                 nTop, ;
                 nWidth, ;
                 nHeight, ;
                 nType ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETCHARTSIZEFROMFILE( ;  // RMC_GetChartsizeFromFile
                 sRMCFile, ;
                 @nWidth, ;   
                 @nHeight ;   
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETCTRLLEFT( ;           // RMC_GetCtrlLeft  
                 nCtrlID ;
                 ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_GETCTRLTOP( ;            // RMC_GetCtrlTop  
                 nCtrlID ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETCTRLWIDTH( ;          // RMC_GetCtrlWidth  
                 nCtrlID ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETCTRLHEIGHT( ;         // RMC_GetCtrlHeight  
                 nCtrlID ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETDATA( ;               // RMC_GetData
                 nCtrlID, ;
                 nRegion, ;
                 nSeriesIndex, ;
                 nDataIndex, ;
                 @nData, ;   // DOUBLE - must be like 0.0 
                 nYData ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETDATACOUNT( ;          // RMC_GetDataCount
                 nCtrlID, ;
                 nRegion, ;
                 nSeriesIndex, ;
                 @nDataCount ;   
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETDATALOCATION( ;       // RMC_GetDataLocation
                 nCtrlID, ;
                 nRegion, ;
                 nSeriesIndex, ;
                 nData, ;   // DOUBLE - must be like 0.0 
                 @nXYPos ;  
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETDATALOCATIONXY( ;     // RMC_GetDataLocationXY
                 nCtrlID, ;
                 nRegion, ;
                 nSeriesIndex, ;
                 nDataX, ;   // DOUBLE - must be like 0.0 
                 nDataY, ;   // DOUBLE - must be like 0.0 
                 @nXPos, ;   
                 @nYPos ;    
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETSERIESDATARANGE( ;    // RMC_GetSeriesDataRange // new
                 nCtrlId             , ;
                 nRegion             , ;
                 nSeries             , ;
                 @nFirst             , ;
                 @nLast                ;
                 ) LIB hRmcDll

DLLxHb FUNCTION RMC_GETGRIDLOCATION( ;       // RMC_GetVersion
                 nCtrlID, ;
                 nRegion, ;
                 @nLeft, ;   
                 @nTop, ;    
                 @nRight, ;  
                 @nBottom ;  
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETHIGHPART(  ;          // RMC_GetHighPart  
                 nParam              ;                          // DOUBLE
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETIMAGESIZEFROMFILE( ;  // RMC_GetImageSizeFromFile
                 sImagePath, ;
                 @nWidth, ;   
                 @nHeight ;   
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETINFO( ;               // RMC_GetINFO
                 nCtrlID, ;
                 @oINFO, ;
                 nRegion, ;
                 nSeries, ; 
                 nIndex ;
                 ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_GETINFOXY( ;             // RMC_GetINFOXY
                 nCtrlID, ;
                 @oINFO, ;
                 nX, ;
                 nY ;
                 ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_GETLOWPART( ;            // RMC_GetLowPart   
                 nParam              ;                          // DOUBLE 
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_GETVERSION( ;
                 ) LIB hRmcDll

DLLxHb FUNCTION RMC_MAGNIFIER( ;             // RMC_Magnifier
                 nCtrlID, ;
                 nEnable, ;
                 nSize, ;
                 nColor, ;
                 nLineColor, ;
                 nTransparency ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_PAINT(nCtrlID) ; // RMC_Paint
                   LIB hRmcDll 

DLLxHb FUNCTION RMC_READDATAFROMFILE( ;      // RMC_ReadDataFromFile
                 @aData, ;   // array elements are DOUBLE - must be like 0.0 
                 sFileName, ;
                 sLines, ;
                 sFields, ;
                 sFieldDelimiter, ;
                 nReverse ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_READSTRINGFROMFILE( ;    // RMC_ReadStringFromFile
                 @sValue, ;  // an array!! sValue[]
                 @sFileName, ;
                 @sLines, ;
                 @sFields, ;
                 @sFieldDelimiter, ;
                 nReverse ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_RESET( ;   // RMC_Reset
                 nCtrlID ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SAVEBMP( ;               // RMC_SaveBMP
                 hBmp, ; 
                 @sFileName ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCAPTIONTEXT( ;        // RMC_SetCaptionText
                 nCtrlID, ;
                 nRegion, ;
                 sText ;
                 ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_SETCAPTIONBGCOLOR( ;     // RMC_SetCaptionBGColor
                 nCtrlID, ;
                 nRegion, ;
                 nColor ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCAPTIONTEXTCOLOR( ;   // RMC_SetCaptionTextColor
                 nCtrlID, ;
                 nRegion, ;
                 nColor ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCAPTIONFONTSIZE( ;    // RMC_SetCaptionFontSize
                 nCtrlID, ;
                 nRegion, ;
                 nFontSize ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCAPTIONFONTBOLD( ;    // RMC_SetCaptionFontBold
                 nCtrlID, ;
                 nRegion, ;
                 nFontBold ;
                 ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_SETCTRLBGCOLOR( ;        // RMC_SetCtrlBGColor
                 nCtrlId, ;
                 nColor ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCTRLBGIMAGE( ;        // RMC_SetCtrlBGImage
                 nCtrlId, ;
                 sBgImage ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCTRLFONT( ;           // RMC_SetCtrlFont
                 nCtrlId, ;
                 sFontName ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCTRLPOS( ;            // RMC_SetCtrlPos
                 nCtrlID, ;
                 nLeft, ;
                 nTop, ;
                 nRelative ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCTRLSIZE( ;           // RMC_SetCtrlSize
                 nCtrlID, ;
                 nWidth, ;
                 nHeight, ;
                 nRelative, ;
	         nRecalcMode ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCTRLSTYLE( ;          // RMC_SetCtrlStyle
                 nCtrlId, ;
                 nStyle ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETCUSTOMTOOLTIPTEXT( ;  // RMC_SetCustomToolTipText
                  nCtrlId, ;
                  nRegion, ;
                  nSeries, ;
                  nDataIndex, ;
                  sText ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETDAXALIGNMENT( ;       // RMC_SetDAXAlignment
                  nCtrlID, ;
                  nRegion, ;
                  nAlignment ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETDAXDECIMALDIGITS( ;   // RMC_SetDAXDecimalDigits
                  nCtrlID, ;
                  nRegion, ;
                  nDecimalDigits, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETDAXFONTSIZE( ;        // RMC_SetDAXFontSize
                  nCtrlID, ;
                  nRegion, ;
                  nFontSize ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETDAXLABELALIGNMENT( ;  // RMC_SetDAXLabelAlignment  // new
                  nCtrlID            , ; 
                  nRegion            , ;
                  nLabelAlignment    , ;
                  nAxisIndex           ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETDAXLABELS( ;          // RMC_SetDAXLabels       // new
                  nCtrlID            , ;
                  nRegion            , ;
                  @sLabels           , ;
                  nAxisIndex           ;
                  ) LIB hRmcDll 


DLLxHb FUNCTION RMC_SETDAXLINECOLOR( ;       // RMC_SetDAXLineColor
                  nCtrlID, ;
                  nRegion, ;
                  nColor ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETDAXLINESTYLE( ;       // RMC_SetDAXLineStyle
                  nCtrlID, ;
                  nRegion, ;
                  nStyle ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETDAXMAXVALUE( ;        // RMC_SetDAXMaxValue
                  nCtrlID, ;
                  nRegion, ;
                  nMaxValue, ;    // DOUBLE - must be like 0.0 
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETDAXMINVALUE( ;        // RMC_SetDAXMinValue
                  nCtrlID, ;
                  nRegion, ;
                  nMinValue, ;    // DOUBLE - must be like 0.0 
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETDAXTEXT( ;            // RMC_SetDAXText
                  nCtrlID, ;
                  nRegion, ;
                  sText, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETDAXTEXTCOLOR( ;       // RMC_SetDAXTextColor
                  nCtrlID, ;
                  nRegion, ;
                  nColor ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETDAXTICKCOUNT( ;       // RMC_SetDAXTickcount
                  nCtrlID, ;
                  nRegion, ;
                  nTickCount ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETDAXUNIT( ;            // RMC_SetDAXUnit
                  nCtrlID, ;
                  nRegion, ;
                  sUnit, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETGRIDBGCOLOR( ;        // RMC_SetGridBGColor
                  nCtrlID, ;
                  nRegion, ;
                  nColor ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETGRIDBICOLOR( ;        // RMC_SetGridBiColor
                  nCtrlID, ;
                  nRegion, ;
                  nBiColor ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETGRIDGRADIENT( ;       // RMC_SetGridGradient
                  nCtrlID, ;
                  nRegion, ;
                  nHasGradient ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETGRIDMARGIN( ;         // RMC_SetGridMargin
                  nCtrlID, ;
                  nRegion, ;
                  nLeft, ;
                  nTop , ;
                  nWidth, ;
                  nHeight ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETHELPINGGRID( ;        // RMC_SetHelpingGrid
                  nCtrlID, ;
                  nSize, ;
                  nGridColor ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXALIGNMENT( ;       // RMC_SetLAXAlignment
                  nCtrlID, ;
                  nRegion, ;
                  nAlignment ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXCOUNT( ;           // RMC_SetLAXCount
                  nCtrlID, ;
                  nRegion, ;
                  nLabelAxisCount ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXFONTSIZE( ;        // RMC_SetLAXFontSize
                  nCtrlID, ;
                  nRegion, ;
                  nFontSize ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXLABELALIGNMENT( ;  // RMC_SetLAXLabelAlignment
                  nCtrlID, ;
                  nRegion, ;
                  nAlignment ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXLABELS( ;          // RMC_SetLAXLabels
                  nCtrlID, ;
                  nRegion, ;
                  sLabels ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXLABELSFILE( ;      // RMC_SetLAXLabelsFile
                  nCtrlId, ;
                  nRegion, ;
                  sFileName, ;
                  sLines, ;
                  sFields, ;
                  sFieldDelimiter ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXLABELSRANGE( ;     // RMC_SetLAXLabelsRange
                  nCtrlId, ;
                  nRegion, ;
                  nFirst, ;
                  nLast ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXLINECOLOR( ;       // RMC_SetLAXLineColor
                  nCtrlID, ;
                  nRegion, ;
                  nColor ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXLINESTYLE( ;       // RMC_SetLAXLineStyle
                  nCtrlID, ;
                  nRegion, ;
                  nStyle ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXTEXT( ;            // RMC_SetLAXText
                  nCtrlID, ;
                  nRegion, ;
                  sText ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETLAXTEXTCOLOR( ;       // RMC_SetLAXTextColor
                  nCtrlID, ;
                  nRegion, ;
                  nColor ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLAXTICKCOUNT( ;       // RMC_SetLAXTickCount
                  nCtrlID, ;
                  nRegion, ;
                  nTickCount ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETLEGENDALIGNMENT( ;    // RMC_SetLegendAlignment
                  nCtrlID, ;
                  nRegion, ;
                  nAlignment ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLEGENDBGCOLOR( ;      // RMC_SetLegendBGColor
                 nCtrlID, ;
                 nRegion, ;
                 nColor ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLEGENDFONTBOLD( ;     // RMC_SetLegendFontBold
                 nCtrlID, ;
                 nRegion, ;
                 nFontBold ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLEGENDFONTSIZE( ;     // RMC_SetLegendFontSize
                 nCtrlID, ;
                 nRegion, ;
                 nFontSize ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLEGENDHIDE( ;         // RMC_SetLegendHide
                 nCtrlID, ;
                 nRegion, ;
                 nHide ;
                 )  LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETLEGENDSTYLE( ;        // RMC_SetLegendStyle
                 nCtrlID, ;
                 nRegion, ;
                 nStyle ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLEGENDTEXT( ;         // RMC_SetLegendText
                 nCtrlID, ;
                 nRegion, ;
                 sLegendText ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETLEGENDTEXTCOLOR( ;    // RMC_SetLegendTextColor
                 nCtrlID, ;
                 nRegion, ;
                 nColor ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETREGIONFOOTER( ;       // RMC_SetRegionFooter
                 nCtrlID, ;
                 nRegion, ;
                 sFooter ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETREGIONMARGIN( ;       // RMC_SetRegionMargin
                  nCtrlID, ;
                  nRegion, ;
                  nLeft, ;
                  nTop , ;
                  nWidth, ;
                  nHeight ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETREGIONBORDER( ;       // RMC_SetRegionBorder
                  nCtrlID, ;
                  nRegion, ;
                  nShowBorder ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETRMCFILE( ;            // RMC_SetRMCFile
                  nCtrlID, ;
                   sRMCFile ;      
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESCOLOR( ;        // RMC_SetSeriesColor
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nColor, ;
                  nIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESEXPLODEMODE( ;  // RMC_SetSeriesExplodeMode
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nExplodeMode ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESDATA( ;         // RMC_SetSeriesData
                 nCtrlId, ;
                 nRegion, ;
                 nSeries, ;
                 @nData, ;    // DOUBLE - must be like 0.0 
                 nDataCount, ;                     
                 nYData ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESDATAFILE( ;     // RMC_SetSeriesDataFile
                 nCtrlId, ;
                 nRegion, ;
                 nSeries, ;
                 sFileName, ;  // This and next 3 lines must NOT be set as
                 sLines, ;     // byref or func won't work.
                 sFields, ;
                 sFieldDelimiter, ;
                 nYData ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESDATARANGE( ;    // RMC_SetSeriesDataRange
                 nCtrlId, ;
                 nRegion, ;
                 nSeries, ;
                 nFirst, ;
                 nLast ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESSINGLEDATA( ;   // RMC_SetSeriesSingleData
                 nCtrlId, ;
                 nRegion, ;
                 nSeries, ;
                 nData, ;      // DOUBLE - must be like 0.0 
                 nDataIndex, ;                     
                 nYData ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESSTARTANGLE( ;   // RMC_SetSeriesStartAngle
                 nCtrlID, ;
                 nRegion, ;
                 nSeries, ;
                 nStartAngle ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESDATAAXIS( ;     // RMC_SetSeriesDataAxis
                 nCtrlId, ;
                 nRegion, ;
                 nSeries, ;
                 nWhichAxis ;
                 ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_SETSERIESHATCHMODE( ;    // RMC_SetSeriesHatchMode
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nHatchMode ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETSERIESHIDE( ;         // RMC_SetSeriesHide
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nHide ;
                  ) LIB hRmcDll 

DLLxhb FUNCTION RMC_SETSERIESHIGHLOWCOLOR( ; // RMC_SetSeriesHighLowColor // new
                  nCtrlID            , ;
                  nRegion            , ;
                  nSeries            , ;
                  nColorLow          , ;
                  nColorHigh           ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETSERIESLINESTYLE( ;    // RMC_SetSeriesLinestyle
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nLinestyle ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETSERIESLUCENT( ;       // RMC_SetSeriesLucent
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nLucent ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESPPCOLUMN( ;     // RMC_SetSeriesPPColumn
                 nCtrlID, ;
                 nRegion, ;
                 nSeries, ;
                 nPointsPerColumn ;
                 ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_SETSERIESPPCOLUMNARRAY(; // RMC_SetSeriesPPColumnArray
                 nCtrlID, ;
                 nRegion, ;
                 nSeries, ;
                 @nFirstPPCValue, ;   
                 nPPCValuesCount ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESVERTICAL( ;     // RMC_SetSeriesVertical
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nVertical ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETSERIESSTYLE( ;        // RMC_SetSeriesStyle
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nStyle ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESSYMBOL( ;       // RMC_SetSeriesSymbol
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nSymbol ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESVALUELABEL( ;   // RMC_SetSeriesValuelabel
                  nCtrlID, ;
                  nRegion, ;
                  nSeries, ;
                  nValuelabel ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSERIESXAXIS( ;        // RMC_SetSeriesXAxis
                 nCtrlId, ;
                 nRegion, ;
                 nSeries, ;
                 nWhichXAxis ;
                 ) LIB hRmcDll 
                     
DLLxHb FUNCTION RMC_SETSERIESYAXIS( ;        // RMC_SetSeriesYAxis
                 nCtrlId, ;
                 nRegion, ;
                 nSeries, ;
                 nWhichYAxis ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETSINGLEBARCOLORS ( ;   // RMC_SetSingleBarColors 
                 nCtrlID, ;                      
                 nRegion, ;
                 @nColor, ;    
                 nColorCount ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETTOOLTIPWIDTH( ;       // RMC_SetToolTipWidth
                 nCtrlID, ;
                 nWidth ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETWATERMARK( ;          // RMC_SetWatermark
                 @sWaterMark, ;
                 nWMColor, ;
                 nWMLucentValue, ;
                 nAlignment, ;
                 nFontSize ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETXAXALIGNMENT( ;       // RMC_SetXAXAlignment
                  nCtrlID, ;
                  nRegion, ;
                  nAlignment, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETYAXALIGNMENT( ;       // RMC_SetYAXAlignment
                  nCtrlID, ;
                  nRegion, ;
                  nAlignment, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETXAXDECIMALDIGITS( ;   // RMC_SetXAXDecimalDigits
                  nCtrlID, ;
                  nRegion, ;
                  nDecimalDigits, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETYAXDECIMALDIGITS( ;   // RMC_SetYAXDecimalDigits
                  nCtrlID, ;
                  nRegion, ;
                  nDecimalDigits, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETXAXFONTSIZE( ;        // RMC_SetXAXFontSize
                  nCtrlID, ;
                  nRegion, ;
                  nFontSize, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETYAXFONTSIZE( ;        // RMC_SetYAXFontSize
                  nCtrlID, ;
                  nRegion, ;
                  nFontSize, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETXAXLABELS( ;          // RMC_SetXAXLabels
                  nCtrlID, ;
                  nRegion, ;
                  sLabels, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETYAXLABELS( ;          // RMC_SetYAXLabels
                  nCtrlID, ;
                  nRegion, ;
                  sLabels, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETXAXLABELALIGNMENT( ;  // RMC_SetXAXLabelAlignment
                  nCtrlID, ;
                  nRegion, ;
                  nLabelAlignment, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETYAXLABELALIGNMENT( ;  // RMC_SetYAXLabelAlignment
                  nCtrlID, ;
                  nRegion, ;
                  nLabelAlignment, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETXAXLINECOLOR( ;       // RMC_SetXAXLineColor
                  nCtrlID, ;
                  nRegion, ;
                  nColor, ;
                  nAxisIndex ;                                    
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETYAXLINECOLOR( ;       // RMC_SetYAXLineColor
                  nCtrlID, ;
                  nRegion, ;
                  nColor, ;
                  nAxisIndex ;                                    
                  ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_SETXAXLINESTYLE( ;       // RMC_SetXAXLineStyle
                  nCtrlID, ;
                  nRegion, ;
                  nStyle, ;
                  nAxisIndex ;                                                      
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETYAXLINESTYLE( ;       // RMC_SetYAXLineStyle
                  nCtrlID, ;
                  nRegion, ;
                  nStyle, ;
                  nAxisIndex ;                                                      
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETXAXMAXVALUE( ;        // RMC_SetXAXMaxValue
                  nCtrlID, ;
                  nRegion, ;
                  nMaxValue, ;   // DOUBLE - must be like 0.0 
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETYAXMAXVALUE( ;        // RMC_SetYAXMaxValue
                  nCtrlID, ;
                  nRegion, ;
                  nMaxValue, ;   // DOUBLE - must be like 0.0 
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETXAXMINVALUE( ;        // RMC_SetXAXMinValue
                  nCtrlID, ;
                  nRegion, ;
                  nMinValue, ;   // DOUBLE - must be like 0.0 
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETYAXMINVALUE( ;        // RMC_SetYAXMinValue
                  nCtrlID, ;
                  nRegion, ;
                  nMinValue, ;   // DOUBLE - must be like 0.0 
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETXAXTEXT( ;            // RMC_SetXAXText
                  nCtrlID, ;
                  nRegion, ;
                  sText, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETYAXTEXT( ;            // RMC_SetYAXText
                  nCtrlID, ;
                  nRegion, ;
                  sText, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETXAXTEXTCOLOR( ;       // RMC_SetXAXTextColor
                  nCtrlID, ;
                  nRegion, ;
                  nColor, ;
                  nAxisIndex ;                  
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETYAXTEXTCOLOR( ;       // RMC_SetYAXTextColor
                  nCtrlID, ;
                  nRegion, ;
                  nColor, ;
                  nAxisIndex ;                  
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETXAXTICKCOUNT( ;       // RMC_SetXAXTickcount
                  nCtrlID, ;
                  nRegion, ;
                  nTickCount, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 
                
DLLxHb FUNCTION RMC_SETYAXTICKCOUNT( ;       // RMC_SetYAXTickcount
                  nCtrlID, ;
                  nRegion, ;
                  nTickCount, ;
                  nAxisIndex ;
                  ) LIB hRmcDll 
                  
DLLxHb FUNCTION RMC_SETXAXUNIT(    ;            // RMC_SetXAXUnit
                  nCtrlID ,;
                  nRegion ,;
                  sUnit  ,;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETYAXUNIT(    ;            // RMC_SetYAXUnit
                  nCtrlID ,;
                  nRegion ,;
                  sUnit  ,;
                  nAxisIndex ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SHOWTOOLTIPS(  ;          // RMC_ShowToolTips
                 nCtrlID  ,;
                 nX       ,;
                 nY        ;
                 ) LIB hRmcDll 

// These 3 functions need work - how to handle the arrays properly...
/*
DLLxHb FUNCTION RMC_SPLIT(         ;          // RMC_Split
                 sData AS STRING  ,;
                 asData[] ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SPLIT2DOUBLE(  ;          // RMC_Split2Double
                 sData AS STRING  ,;
                 aData[] ;  // array elements are DOUBLE - must be like 0.0 
                 ) LIB hRmcDll 
                 
DLLxHb FUNCTION RMC_SPLIT2LONG(    ;          // RMC_Split2Long
                 sData AS STRING  ,;
                 aData[]   ;
                 ) LIB hRmcDll 
*/

DLLxHb FUNCTION RMC_WRITERMCFILE(  ;          // RMC_WriteRMCFile
                 nCtrlID  ,;
                 @sFileName ;
                 ) LIB hRmcDll 

DLLxHb FUNCTION RMC_ZOOM( ;                   // RMC_Zoom
                  nCtrlID ,;
                  nMode   ,;
                  nColor  ,;
                  nLineColor    ,;
                  nTransparency  ;
                  ) LIB hRmcDll 

DLLxHb FUNCTION RMC_SETMOUSECLICK( ;
                 nCtrlId  ,;
                 nButton  ,;
                 nX       ,;
                 nY       ,;
                 @oInfo    ; // tRMC_INFO
                 ) LIB hRmcDll 

//--------------------------------------------------------------------------//
  // Replacement for RMC_ReadDataFromFile() and RMC_ReadStringFromFile()
  // (The 1st of these RMC funcs is obsolete, per RMChart.chm docs, yet is
  // still used in the RmcDemo, hence this replacement. The 2nd isn't 
  // documented in Rmchart.chm, so due to its apparent similar functionality,
  // its functionality is included it here via lnRetNum. - R. Seiler )
FUNCTION XHB_ReadDataFromFile( aData, sFileName, sLines, sFields, ;
                               sDelim, lnReverse, lnGetStrings )
LOCAL aWork  := {}    ,;
      cText  := ""    ,;
      cTextB := ""    ,;
      cWork  := ""    ,; 
      i      := 0     ,;
      lNo13  := .f.   ,;
      nAt    := 0     ,;
      nAtB   := 0     ,;
      nCnt   := 0     ,;
      nRnd   := 0     ,;
      nRndB  := 0

IF EMPTY(lnReverse)
   lnReverse := 0
ENDIF
IF EMPTY(lnGetStrings)
   lnGetStrings  := 0
ENDIF

aData := {}

IF !FILE(sFileName)

   Alert( sFileName + " file is not available." )

   Return 0
ENDIF

cText := MEMOREAD(sFileName)

IF AT(CHR(13),cText) = 0
   lNo13 := .t.
ENDIF

IF SUBSTR(sLines,1,2) == "-1"     // Reverse the order of data records
   IF SUBSTR(cText,LEN(cText),1) = CHR(10)
      IF !lNo13
         cText := SUBSTR(cText,1,AT(CHR(13)+CHR(10),cText)-1)
      ELSE
         cText := SUBSTR(cText,1,AT(CHR(10),cText)-1)
      ENDIF
   ENDIF

   DO WHILE LEN(cText) > 2
      cWork := ""
      IF !lNo13
         nAt := MAX(RAT(CHR(13)+CHR(10),cText),1)
      ELSE
         nAt := MAX(RAT(CHR(10),cText),1)
      ENDIF
      // Make sure each line has appropriate CR at its end...
      IF nAt > 1 .AND. LEN(cText) > nAt+1
         IF !lNo13
            cWork := SUBSTR(cText,nAt+2,LEN(cText)) + CHR(13)+CHR(10)
         ELSE
            cWork := SUBSTR(cText,nAt+1,LEN(cText)) + CHR(10)
         ENDIF
      ELSEIF nAt = 1 .AND. LEN(cText) > 1
         IF !lNo13
            cWork := SUBSTR(cText,1,LEN(cText)) + CHR(13)+CHR(10)
         ELSE
            cWork := SUBSTR(cText,1,LEN(cText)) + CHR(10)
         ENDIF
      ENDIF
      cTextB := cTextB + cWork  // Build text lines in reverse order in cTextB
      IF nAt - 1 > 0
         cText := SUBSTR(cText,1,nAt-1)
      ELSE
         cText := ""
      ENDIF
      SysRefresh()
      CursorWait()
      nCnt++
   ENDDO
   cText  := cTextB
   cTextB := ""
ENDIF

// COULD ADD CODE TO ACCOMODATE 2nd PART OF sLines - # of lines to select 

nCnt := 0
DO WHILE LEN(cText) > 2 .AND. nRnd < 1000
   aWork := {}
   IF !lNo13
      nAt := MIN(AT(CHR(13)+CHR(10),cText),LEN(cText))
   ELSE
      nAt := MIN(AT(CHR(10),cText),LEN(cText))
   ENDIF
   cWork := SUBSTR( cText, 1,nAt )
   // Elim CR in cWork...
   IF SUBSTR(cWork,LEN(cWork),1) = CHR(10)
      IF lNo13
         cWork := SUBSTR(cWork,1,LEN(cWork)-1)
      ELSE
         cWork := SUBSTR(cWork,1,LEN(cWork)-2)
      ENDIF
   ENDIF
   nRndB := 0
   // Breakdown a line (row) of data into its individual data cells and put
   // them in an array for processing...
   DO WHILE LEN(cWork) > 2  .AND. nRndB < 50
      nAtB := AT( sDelim, cWork )
      IF nAtB = 0
         nAtB := LEN(cWork)+1
      ENDIF
      AADD(aWork, SUBSTR(cWork,1,nAtB-1) )
      IF LEN(cWork) > nAtB
         cWork := SUBSTR(cWork,nAtB+1,LEN(cWork))
      ENDIF
      SysRefresh()
      CursorWait()
      nRndB++
   ENDDO

// ALSO COULD ADD CODE TO ACCOMODATE sFields WITH > 1 column (index) selection

   i := VAL(SUBSTR(sFields,1,1))

   // Find the requested data cell in the line's data array and add it to the 
   // output data array...
   IF i > 0 .AND. LEN(aWork) >= i
      IF lnGetStrings = 0  // False
         AADD( aData, VAL(aWork[i]) )           // aData builder, numeric
      ELSE
         AADD( aData, aWork[i] )                // aData builder, strings
      ENDIF
      nCnt++
   ENDIF
   IF LEN(cText) > nAt+1
      cText := SUBSTR(cText,nAt+2,LEN(cText))
   ELSE
      cText := ""
   ENDIF
   SysRefresh()
   CursorWait()
   nRnd++
ENDDO

CursorArrow()

RETURN nCnt

//--------------------------------------------------------------------------//

