en Ejemplos, GUI

Ejemplo RMChart desde DLL

2015-10-23_202626

Descarga Ejemplo Aquí

/*
 * RMChart DLL Demo by (c)2015 MigSoft 
 */

#include "oohg.ch"

#define ID_CHART   1001
#define ID_CHART_2 1002

#define RMC_DEFAULT   O
#define RMC_PORTRAIT  1
#define RMC_LANDSCAPE 2

#define RMC_EMF       1
#define RMC_EMFPLUS   2
#define RMC_BMP       3


Function Main()

  DEFINE WINDOW Win_1 ;
    AT 0,0 ;
    WIDTH 800 ;
    HEIGHT 600 ;
    TITLE 'Test RMChart By (c)2015 MigSoft' ;  
    ON INIT Chart( MyFillData(1) ) ;
    MAIN 
  
    DEFINE MAIN MENU
      DEFINE POPUP 'Test'
        MENUITEM 'Chart 1 View'  ACTION Chart( MyFillData(1) )
        MENUITEM 'Chart 1 Print' ACTION PrintChart( MyFillData(1) ) 
        SEPARATOR
        MENUITEM 'Chart 2 View'  ACTION Chart( MyFillData(2) )
        MENUITEM 'Chart 2 Print' ACTION PrintChart( MyFillData(2) )
        SEPARATOR
        MENUITEM 'Chart 3 View'  ACTION Chart( MyFillData(3) )
        MENUITEM 'Chart 3 Print' ACTION PrintChart( MyFillData(3) )
      END POPUP
    END MENU

  END WINDOW
  
  CENTER WINDOW Win_1
  ACTIVATE WINDOW Win_1

Return

*-----------------------------------------------------------------------------*
Procedure Chart( cData )
*-----------------------------------------------------------------------------*

        CallDll32 ( "RMC_CREATECHARTFROMFILE" , "RMCHART.DLL" , GetFormHandle("Win_1"), ;
                    ID_CHART, 10, 10, 0, cData  )        
        CallDll32 ( "RMC_DRAW" , "RMCHART.DLL" , ID_CHART  )        

Return

*-----------------------------------------------------------------------------*
Procedure PrintChart( cData )
*-----------------------------------------------------------------------------*

    CallDll32 ( "RMC_CREATECHARTFROMFILE" , "RMCHART.DLL" , GetFormHandle("Win_1"), ;
                 ID_CHART_2, 10, 10, 1, cData  )        

    IF CallDll32 ( "RMC_DRAW2PRINTER" , "RMCHART.DLL" , ID_CHART_2, RMC_LANDSCAPE, ;
                   10, 10, 250, 150, RMC_EMFPLUS  )  < 0
       MsgStop("Print error!", "Error")   
       
    ENDIF

    CallDll32 ( "RMC_DELETECHART" , "RMCHART.DLL" , ID_CHART_2  )        

Return


Function MyFillData( nOp )
    Local sData := "" 

  If nOp == 3
    sData += "00003650|00004450|000051|000061|000071|00008-6697831|00009401|00011Tahoma|100011"
    sData += "|1000310|1000410|10005-5|10006-5|1000910|100101|100111|100121|100131|100181|1002"
    sData += "00|100217|1002215|100238|100272|100331|100341|100358|100378|100411|100482|100492"
    sData += "|10051-6751336|10052-15132304|10053-983041|100541|100558|10056-16777077|10057-16"
    sData += "777077|100586|10060-16777077|10061-1468806|100622|10180data source: www.federalr"
    sData += "eserve.gov + www.ecb.int|10181Prime Rates in USA and Euroland|10183 %|101871999*"
    sData += "2000*2001*2002*2003*2004*2005*2006|110011|1100221|110035|1100434|110052|110063|1"
    sData += "10073|1100970|1101312|110171|11019-16744448|1102115|110221|1102396|110262|110521"
    sData += "2|110534.75*4.75*4.75*4.75*4.75*5*5*5.25*5.25*5.25*5.5*5.5*5.5*5.75*6*6*6.5*6.5*"
    sData += "6.5*6.5*6.5*6.5*6.5*6.5*5.5*5.5*5*4.5*4*3.75*3.75*3.5*3*2.5*2*1.75*1.75*1.75*1.7"
    sData += "5*1.75*1.75*1.75*1.75*1.75*1.75*1.75*1.25*1.25*1.25*1.25*1.25*1.25*1.25*1*1*1*1*"
    sData += "1*1*1*1*1*1*1*1*1*1*1.25*1.5*1.75*2*2.25*2.25*2.5*2.75*2.75*3*3.25*3.25*3.5*3.75"
    sData += "*3.75*4*4.25*4.5*4.5*4.75*4.75*5*5.25*5.25*5.25*5.25*5.25*5.25*5.25|120011|12002"
    sData += "21|120035|1200434|120052|120063|120073|1200950|1201312|120171|12019-2448096|1202"
    sData += "115|120221|1202396|120262|1205212|120533*3*3*2.5*2.5*2.5*2.5*2.5*2.5*2.5*3*3*3*3"
    sData += ".25*3.5*3.75*3.75*4.25*4.25*4.5*4.5*4.75*4.75*4.75*4.75*4.75*4.75*4.75*4.5*4.5*4"
    sData += ".5*4.25*3.75*3.75*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3.25*3."
    sData += "25*2.75*2.75*2.75*2.5*2.5*2.5*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*"
    sData += "2*2*2*2*2*2.25*2.25*2.25*2.5*2.5*2.5*2.75*2.75*3*3*3.25*3.25*3.5|010011|010054|0"
    sData += "100721|01014-16744448|010222|01024216*287|01025109*109|010272|010283|010012|0100"
    sData += "51|01010295|01011102|010191|01026USA (Federal Funds Rate)|010013|010054|0100721|"
    sData += "01014-10496|010222|01024260*287|01025192*192|010272|010283|010014|010051|0101029"
    sData += "5|01011185|010191|01026Euroland (Prime Rate)" 
  Endif
  
  If nOp == 2   
    sData := "00003670|00004450|000051|000061|000071|00008-10185235|00009310|00011Tahoma|10001" + ;
             "1|100035|1000410|10005-5|10006-5|1000912|100101|100111|100131|100181|10020100000" + ;
             "|10021250000|1002211|100239|100281|100292|100300|100310|100322|100331|100341|100" + ;
             "3510|100378|100482|100492|10051-32944|10052-1296|10053-983041|100541|100558|1005" + ;
             "6-1828|10057-16777216|100592|10060-1828|10061-16777216|10180data source: F.A.Z|1" + ;
             "0181The world's 10 biggest industrial companies 2003|10183$ |10184Total turnover" + ;
             " in Mill. Dollar|10185 %|10186Net operating margin|10187Exxon Mobil*Royal Dutch " + ;
             "/ Shell*BP*General Motors*Daimler Chrysler*Ford Motor*Toyota Motor*General Elect" + ;
             "ric*TOTAL*Chevron Texaco|110011|110021|110031|110043|110053|11006-1|1100950|1101" + ;
             "31|11014-1|110171|11019-10496|1102111|110221|1102310|11053242365*235598*232571*1" + ;
             "85524*170457*164196*149321*132797*130067*119703|120011|1200221|120035|1200422|12" + ;
             "0052|120061|120071|1200970|120111|120121|120131|1201421|120171|12019-16744448|12" + ;
             "02115|120221|1202310|120261|120538.9*4.1*4.4*2.1*.3*.3*5.9*11.3*6.7*6"
  Endif
  
  If nOp == 1   
    sData := "00003700|00004500|000054|000061|000071|00008-984833|00009310|00011Tahoma|100011|" + ;
             "100032|100042|10005348|10006248|1000910|100101|100111|100181|100200|10021100|100" + ;
             "2211|100238|100331|100341|100355|100378|100481|100491|10051-984833|10052-1677721" + ;
             "6|10053-657956|100541|100558|10056-16777216|10057-16777216|10060-16777216|10061-" + ;
             "16777216|10187Label 1*Label 2*Label 3*Label 4*Label 5|110011|110021|110031|11004" + ;
             "6|110056|11006-1|110091|110131|11014-1|110171|1102111|110221|110235|1105330*40*7" + ;
             "0*60*20|200011|20003352|200042|20005-2|20006248|2000910|200101|200111|200181|200" + ;
             "200|20021100|2002211|200238|200331|200341|200355|200378|200484|200491|20051-9848" + ;
             "33|20052-16777216|20053-657956|200544|200555|20056-16777216|20057-16777216|20060" + ;
             "-16777216|20061-16777216|20187Label 1*Label 2*Label 3*Label 4*Label 5|210011|210" + ;
             "023|210033|210045|210055|21006-1|210091|210101|210131|21014-1|210171|2102111|210" + ;
             "221|210235|2105320*10*15*25*30|220011|220023|220033|220045|220055|22006-1|220091" + ;
             "|220101|220131|22014-1|220171|2202111|220221|220235|2205325*30*10*20*15|230011|2" + ;
             "30023|230033|230045|230055|23006-1|230091|230101|230131|23014-1|230171|2302111|2" + ;
             "30221|230235|2305310*20*40*20*30|240011|240023|240033|240045|240055|24006-1|2400" + ;
             "91|240101|240131|24014-1|240171|2402111|240221|240235|2405340*30*20*30*20|300011" + ;
             "|300032|30004252|30005348|30006-2|3000910|300101|300181|300481|300491|30051-9848" + ;
             "33|30052-16777216|30053-657956|310011|3100251|310031|3100454|310054|310071|31009" + ;
             "1|310121|310151|310161|310171|310182|310211|310221|310235|3105330*50*20*40*60|40" + ;
             "0011|40003352|40004252|40005-2|40006-2|4000910|400101|400111|400131|400181|40020" + ;
             "100|40021250|4002211|400238|400281|400292|400300|400310|400322|400331|400341|400" + ;
             "3510|400378|400482|400492|40051-984833|40052-16777216|40053-984833|400541|400558" + ;
             "|40056-16776961|40057-16777216|400592|40060-16777216|40061-16777216|40183$ |4018" + ;
             "5 %|410011|410021|410031|410043|410053|41006-1|4100950|410131|41014-1|410171|410" + ;
             "19-10496|4102111|410221|4102310|41053240*230*220*180*170*160*145*130*125*115|420" + ;
             "011|4200221|420035|4200422|420052|420061|420071|4200963|420111|420121|420131|420" + ;
             "171|42019-16744448|4202115|420221|4202310|420261|420538.1*6.2*4.3*2.2*1.2*3.1*5." + ;
             "2*11.4*7.3*4.2"
  Endif
    
Return(sData)