topic
stringlengths
1
63
text
stringlengths
1
577k
Antonio: linking errors (Not solved)
Gustavo, Please link hbsix.lib from xHarbour
Antonio: linking errors (Not solved)
Antonio: The latest xHarbour does not have the hbsix library. ALso in my FW 1309 batch (buildx.bat) file I have the following: [code=fw:22szbug3]<div class="fw" id="{CB}" style="font-family: monospace;">echo %hdirl%\hbsix.lib + >> b32.bc</div>[/code:22szbug3] Any clues ? Thank you
Antonio: linking errors (Not solved)
Gustavo, hbsix.lib is included here: [url:2tgwcdjm]https&#58;//code&#46;google&#46;com/p/harbour-and-xharbour-builds/downloads/detail?name=xharbour_20131007&#46;zip[/url:2tgwcdjm]
Antonio: nStrCrC()
Antonio, above function seems not included in FWH-libs for Community 2015! (FWH 16/04)
Antonio: nStrCrC()
Günther, Included for next FWH version thanks
Antonio: nStrCrC()
Hallo Günther, vorerst liebe Grüße aus Osttirol. Bist du mit deiner Software von der RKSV betroffen. lg Otto
Antonio: nStrCrC()
Hallo Otto, nein bin nicht betroffen. Mache Software für (Schützen-)Vereine und den öffentlichen Dienst. Liebe Grüße nach Osttirol!
Antonio: no puedo compilar los ejemplos
Antonio: No logro compilar los ejemplos que vienen en \samples me da el siguiente error: Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland Error: Unresolved external '_HB_FUN_CLASSCREATE' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Error: Unresolved external '_HB_FUN_CLASSOBJECT' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Error: Unresolved external '_HB_FUN_DBCREATEEXTSTRUCT' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Error: Unresolved external '_HB_FUN_DBCREATEFROM' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Error: Unresolved external '_HB_FUN_FIELDINFO' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Error: Unresolved external '_HB_FUN_DBESETDEFAULT' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Error: Unresolved external '_HB_FUN_DBELOAD' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Error: Unresolved external '_HB_FUN_DBEBUILD' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Error: Unresolved external '_HB_FUN__EARLYBOUNDCODEBLOCK' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Error: Unresolved external '_HB_FUN__SYMRELEASE' referenced from P:\FWH27\LIB\FIVEHX.LIB|DB10 Por favor... Muchas gracias!
Antonio: no puedo compilar los ejemplos
Intenta con el archivo bat que te envie a tu hotmail.
Antonio: no puedo compilar los ejemplos
Db10.prg no pertenece a FiveH.lib. Es sólo para Xbase++.
Antonio: no puedo compilar los ejemplos
Gracias, recompile la libreria sin db10 y se soluciono el problema, gracias!!!
Anular Salida de dialog con scape
¿Como se anula que se cierre una ventana de un dialogo con escape? Saludos.
Anular Salida de dialog con scape
lSalir = .F. ACTIVATE DIALOG oDlg VALID lSalir El diálogo no terminará con escape, ní intentándo cerrarlo, hasta que lSalir sea .T.
Anular Salida de dialog con scape
[quote="Antonio Linares":12rch0lc]lSalir = .F. ACTIVATE DIALOG oDlg VALID lSalir El diálogo no terminará con escape, ní intentándo cerrarlo, hasta que lSalir sea .T.[/quote:12rch0lc] Está en lo correcto Antonio. Si te sirve te doy un pequeño ejemplo: [code:12rch0lc]DEFINE DIALOG oDlg RESOURCE "PRUEBA" OF oPadre REDEFINE BUTTON ID 301 OF oDlg ACTION &#40; oDlg&#58;bValid&#58;=&#123; || &#46;T&#46;&#125;, oDlg&#58;End&#40;&#41;&#41; ; CANCEL ACTIVATE DIALOG oDlg CENTER VALID &#46;F&#46;[/code:12rch0lc] Te explico: al utilizar "VALID .F." en el ACTIVATE DIALOG, estamos indicando que aunque presiones la tecla ESC o presiones la X del diálogo, éste no se cerrará. Lo importante es que te fijes en lo que hace el botón. En este caso saqué esto de un dialogo que utilizo desde recursos y ese botón cuando se presiona me aseguro que cambie el valor de oDlg:bValid que fue definida en el VALID del ACTIVATE DIALOG a .T. y luego le doy con el oDlg:End() la orden de que se cierre el diálogo. Y como dice mi muy querido amigo Vikthor: "listo el pollo" Saludos David Lagos S. Coquimbo-Chile
Anular Salida de dialog con scape
Otra opción para evitar la tecla ESC sería ACTIVATE DIALOG oDlg NOWAIT CENTERED VALID ! GetAsyncKey(VK_ESCAPE) Saludos
Anular Salida de dialog con scape
Yo utilizo una pequeña funcion: [b:2d7131qe]FUNCTION NoScape() RETURN !( GetKeyStat( 27 ) )[/b:2d7131qe] La aplico así ACTIVATE DIALOG oDlg VALID [b:2d7131qe]NoScape()[/b:2d7131qe] ó si necesito otra validación ACTIVATE DIALOG oDlg VALID IF([b:2d7131qe]NoScape()[/b:2d7131qe], <VALIDACION> ,.F.) ó en una funcion: ACTIVATE DIALOG oDlg VALID FuncionValidacion(...) FUNCTION FuncionValidacion(...) LOCAL lRet := [b:2d7131qe]NoScape()[/b:2d7131qe] IF lRet ... ... lRet := .T. ó .F. ... ... ENDIF RETRUN lRet Me va muy bien Saludos
Anular acceso 'Propiedades de Fecha y Hora' en barra mensaje
Hola a todos: ¿Qué tengo que hacer para que en la barra de mensajes se siga viendo la fecha y la hora pero que al pulsar sobre ellas no acceda a 'Propiedad de fecha y hora?. Un saludo.
Anular acceso 'Propiedades de Fecha y Hora' en barra mensaje
<oBar>:oClock:bAction = { || nil } <oBar>:oDate:bAction = { || nil }
Anular acceso 'Propiedades de Fecha y Hora' en barra mensaje
Muchas gracias,Antonio. Funcionó estupendamente. Un saludo.
Anular parpadeo de oWndChilds
Cuando se abre una ventana hija (oChild) siempre se produce un parpadeo. ¿Cómo se evita? Gracias.
Anular parpadeo de oWndChilds
Francisco, Ejecuta este ejemplo y selecciona en el menu "childs", "new". Aqui no aparece ningún parpadeo: [code=fw:pmcb0gt7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDI</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:pmcb0gt7]
Anular parpadeo de oWndChilds
Antonio, gracias por contestar. Quizás no empleé el concepto adecuado (parpadeo). Cuando se abre una Child, ésta trae un tamaño pre-definido, ó el tamaño que le asignas al definirla. Cuando se activa, se nota el cambio entre el tamaño original y el deseado (por ejemplo MAXIMIZED), y es aquí donde se visualiza una especie de intermitencia. (talvez en equipos poderosos, no) Me preguntaba si hay alguna manera de evitar esto, pintando de una sola vez la Child con el tamaño deseado. Con los diálogs no lo he notado. Saludos.
Anular parpadeo de oWndChilds
Francisco, Prueba este ejemplo: [code=fw:xdg90tnn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oWnd<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDI</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> CreateChild<span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> CreateChild<span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oChild<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oChild <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">MDICHILD</span><br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oChild <span style="color: #0000ff;">MAXIMIZED</span><br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span>   <br /> </div>[/code:xdg90tnn] Sigue sin haber parpadeo (Windows 7).
Anular parpadeo de oWndChilds
Gracias Antonio, resuelto. Al establecer el tamaño en el ON INIT de la propia oChil, mejoró notablemente. DEFINE WINDOW oChild MDICHILD OF oWnd TITLE cTitu +" "+ cAlias ; FROM 0, 0 TO oWnd:nHeight-140, oWnd:nWidth-4 PIXEL ; COLOR nRGB(247, 243, 232), nRGB(228, 213, 184) ; NOCAPTION BORDER NONE ... ... ACTIVATE WINDOW oChild; ON INIT (oChild:nHeight:=oWnd:nHeight-4, oChild:nWidth:=oWnd:nWidth-4 ,; //tam deseado oFechemis:SetFocus(),; oBrw:nHeight := oChild:nHeight-163, oBrw:nWidth := oChild:nWidth-8, oBrw:nTop:=130 ) ; VALID ( oBrw:CancelEdit(), if( PuedeSalir(cAlias),((cAlias)->(dbCloseArea()), Ferase( ".\"+cAlias+".dbf" ), dbSelectArea(cOldSele), .T.),.f.) ) Saludos.
Anuncios en el Foro?
Antonio Hoy lunes 21 al navegar al foro veo que tienes publicidad en el foro. Es correcto o te han hecho travesuras los Hackers? Saludos Armando
Anuncios en el Foro?
Armando, Es correcto. Lo vamos a tener en pruebas un mes ó así, a ver que tal funciona <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Anuncios en el Foro?
Antonio: La publicidad ahora esta saliendo con popup, y verdad que se pone latera la cosa Saludos Patricio
Anuncios en el Foro?
Antonio, en principio creí que mi barra anti-popup no funcionaba. Pero es cierto hoy me están saliendo Popups a diestro y siniestro que ralentizan mucho la consulta del foro. Sin embargo estos días atrás, no salian, tampoco podía entrar en la página de los anuncios, hoy sí.
Anuncios en el Foro?
Ya están quitados los popups. Ha sido un error de configuración. Sí, son incomodísimos.
Anuncios en el Foro?
No sé si será casualidad, pero despues de entrar ayer en el foro, empezaron a salirme las ventanitas y el antivirus me dectecto un spyware (23100247.exe) que me ha costado el ciento y la madre eliminarlo.
Anuncios en el Foro?
Manuel, Las dos empresas de publicidad que estamos usando son bien conocidas y no creo que esten distribuyendo spyware. Los popups se quitaron y no han vuelto a aparecer. Si notamos algo raro por supuesto que eliminaríamos de inmediato la publicidad. La idea es aumentar la capacidad y prestaciones del servidor de estos foros y vamos a ver si este tipo de publicidad puede ayudar a conseguirlo.
Anxiously waiting for CrunchPad :-)
[url:24i9tgd9]http&#58;//en&#46;wikipedia&#46;org/wiki/CrunchPad[/url:24i9tgd9] [url:24i9tgd9]http&#58;//www&#46;techcrunch&#46;com/2008/07/21/we-want-a-dead-simple-web-tablet-help-us-build-it/[/url:24i9tgd9] [url:24i9tgd9]http&#58;//www&#46;techcrunch&#46;com/2009/06/03/crunchpad-the-launch-prototype/[/url:24i9tgd9] [quote:24i9tgd9]... So let’s design it, build a few and then open source the specs so anyone can create them. [/quote:24i9tgd9] Love his open source manifest. Hopefully he respects it... [img:24i9tgd9]http&#58;//img190&#46;imageshack&#46;us/img190/1692/crunchpad&#46;png[/img:24i9tgd9] [img:24i9tgd9]http&#58;//img403&#46;imageshack&#46;us/img403/1911/crunch2&#46;jpg[/img:24i9tgd9]
Anxiously waiting for CrunchPad :-)
Wow, fantastic <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> I also read that Apple wants to make a machine like this one. But the price...
Any Reports or reportgen. supports VERTICAL text ?
Hello, DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10 [color=#FF0000:2rhgizf5]DEFINE FONT oFont2 NAME 'TAHOMA' SIZE 0,-12 NESCAPEMENT 900[/color:2rhgizf5] does TReport support vertical text or maybe a useful Reportgenerator ? I had a look at Easyreport 2, but it seems, vertical text is not supported. [img:2rhgizf5]http&#58;//www&#46;pflegeplus&#46;com/pictures/vertical,jpg[/img:2rhgizf5] Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Any Reports or reportgen. supports VERTICAL text ?
Ukoenig: EasyReport supports vertical text. Here is an image [url=http&#58;//subefotos&#46;com/ver/?7fad593218990bcf3eec9ec8d54c1b50o&#46;jpg:1sqz274p][img:1sqz274p]http&#58;//thumbs&#46;subefotos&#46;com/7fad593218990bcf3eec9ec8d54c1b50o&#46;jpg[/img:1sqz274p][/url:1sqz274p] Regards
Any Reports or reportgen. supports VERTICAL text ?
Fastreport can, choose text font like @xxx , Regards! Shuming Wang
Any Reports or reportgen. supports VERTICAL text ?
Fast Report
Any Reports or reportgen. supports VERTICAL text ?
why not ask to charles to insert on his vrd ?
Any Reports or reportgen. supports VERTICAL text ?
Hi Ukoenig ! . . . Follow the project below ( MR-Print ), Now available a method to print text From 0° to 360° . . . GitHub CVS ( repository ): [url:cl6v3a76]https&#58;//github&#46;com/MRonaldo/MR-Tools/downloads[/url:cl6v3a76] . . . On this forum: [url:cl6v3a76]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=25004#p135958[/url:cl6v3a76] . . . Best Regards
Any chance of a timer?
I really need a timer for one part of my application. I don't suppose anyone has done one for xHarbour/FiveLinux? Anyone with any pointers as to how I might go about creating one? Please someone! I would be eternally grateful xProgrammer
Any chance of a timer?
Doug, We may have them ready for today <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Any chance of a timer?
Doug, This is already working fine. We email you new files: [code:3f7efrjj] #include "FiveLinux&#46;ch" function Main&#40;&#41; local oWnd, oTmr DEFINE WINDOW oWnd TITLE "Testing timers" DEFINE TIMER oTmr INTERVAL 200 ACTION oWnd&#58;SetText&#40; Time&#40;&#41; &#41; ACTIVATE TIMER oTmr ACTIVATE WINDOW oWnd return nil [/code:3f7efrjj]
Any chance of a timer?
Antonio I hope that your customers appreciate the wonderful effort you put in to supporting your products and your preparedness to try to meet their needs. Doug
Any chance of a timer?
Doug, Thanks for your kind words <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Any change in ALT-Z with FWH27?
Hi, in FWH25, a button like &Zoek (Search) worked when using the ALT key in combination with the Z, and standing in a GET. Since i've upgraded (FWH27/xHarbour 0.99.51), using the ALT-Z combination clears the GET, and that's it. Any ideas how to get my original functionality back? Thanks in advance! John.
Any change in ALT-Z with FWH27?
John, Do you see the underscore "_" under the "Z" ? Could you please post a screenshot here ? (use imageshack.com to host the image)
Any change in ALT-Z with FWH27?
Hi Antonio, When pressing the ALT key, the underscores appear. This is what's in my RC file: PUSHBUTTON "&Zoek", 303, 126, 224, 50, 14 ... EDITTEXT 305, 14, 224, 110, 13 And in my app: REDEFINE BUTTON oZoek ID 303 OF oDlg .... REDEFINE GET oZoekString VAR cZoekString ID 305 of oDlg valid if(GETKEYSTATE(VK_RETURN),(ZoekString(cBestand, cZoekString,oBrw),oZoekString:oJump:=oZoekString,.T.),.T.) The function ZoekString does the actual searching in the DBF. Thanks in advance, John.
Any change in ALT-Z with FWH27?
John, This sample works ok: <!-- m --><a class="postlink" href="http://hyperupload.com/download/d385d963/john.zip.html">http://hyperupload.com/download/d385d963/john.zip.html</a><!-- m --> Could you please test it there and let us know if it works ok for you ? Thanks.
Any change in ALT-Z with FWH27?
Antonio, your example works fine. So it seems the extra code i use, makes the contents of the GET dissapear. Strangely enough, this worked in the previous version... Thanks, John.
Any change in ALT-Z with FWH27?
John, If you could provide us a sample to reproduce the problem, that would help very much. Thanks.
Any change in ALT-Z with FWH27?
John, Thanks for your emailed sample. Already fixed in your code and sent back to you.
Any clever coders out there
Hi allI have a function which seeks for a price in a table which can have upto 64 different combinations. As a result of this there are 64 seeks per find which is quite fast in dbf but horribly slow in sql.Can anyone suggest a better way for writting this function.I will pay for any good ideasThanksPeter code isFUNCTION find_price(sp_site,sp_acc,sp_sit,sp_con,sp_was,sp_reg,sp_eff,sp_ctype,sp_disp) LOCAL element := {"","","","","",""} LOCAL alldone := .F. LOCAL binary := 63 LOCAL old_area := SELECT() PRIVATE element1,element2,element3,element4,element5,element6,spsite spsite := sp_site SELECT SKIPPRIC DO WHILE !alldone .AND. binary >= 0 element1 := IF(LAND(32,binary),sp_acc,SPACE(10)) element2 := IF(LAND(16,binary),sp_sit,SPACE(10)) element3 := IF(LAND(8,binary),sp_ctype,SPACE(10)) element4 := IF(LAND(4,binary),sp_was,SPACE(10)) element5 := IF(LAND(2,binary),sp_reg,SPACE(10)) element6 := IF(LAND(1,binary),sp_disp,SPACE(10)) SKIPPRIC->(SR_SETFILTER("site_id="+STR(spsite)+" and sp_contain='"+Alltrim(sp_con)+"'")) IF SKIPPRIC->(DBSEEK(STR(sp_site,2,0)+element1+element2+element3+sp_con+element4+element5+element6)) DO WHILE SKIPPRIC->SITE_ID == sp_site .AND. ; SKIPPRIC->SP_CUSTNO == element1 .AND. ; SKIPPRIC->UNIQ_NBR == element2 .AND. ; SKIPPRIC->SP_CUSTYPE == element3 .AND. ; SKIPPRIC->SP_CONTAIN == sp_con .AND. ; SKIPPRIC->SP_WASTE == element4 .AND. ; SKIPPRIC->SP_REGION == element5 .AND. ; SKIPPRIC->SP_DISPSIT == element6 .AND. ; !SKIPPRIC->(EOF()) IF ((SKIPPRIC->SP_DELDATE >= sp_eff .OR. ; SKIPPRIC->SP_DELDATE == CTOD("")) .AND. ; SKIPPRIC->SP_EFFDATE <= sp_eff) alldone := .T. EXIT ENDIF SKIPPRIC->(DBSKIP()) ENDDO ENDIF IF !alldone --binary ENDIF ENDDO SELECT(old_area)RETURN alldone[
Any clever coders out there
How about using arrays for this?At the beginning of the work session, you could load the data from SKIPPRIC into a separate array for each database field, and then using ASCAN() your lookups should be lightning fast, even with SQL.
Any clever coders out there
Peter,Can you provide a small self-contained program with the DBF and some example calls to the function and the proper results? This would allow us to test it and try to improve the speed.James
Any clever coders out there
Roger,I think the problem is that the array has to be built for each call to the function, not per worksession (I am assuming "worksession" is each time the application is run). Still it might be faster.James
Any clever coders out there
Peter,As you mention, the delay comes from the 64 seeks.Don't do 64 seeks: Use just one SQL query sentence.
Any clever coders out there
James,From Peter's data, it looks as though his pricing factors, though complex, are actually constants. In his pricing function, it seems that the price for a given situation is determined by the interrelation between the specifics of the case and all of the constants involved in his pricing factors. If so, he should only have to build the arrays once during a worksession, and then refer to the arrays each time he calls the pricing function, thereby avoiding the slow disk seeks. But if the pricing factors themselves are variables within the scope of a worksession, then you're right, the arrays approach definitely won't work.- Roger
Any clever coders out there
Roger,You are correct--there are a number of constants, and it is not clear exactly what he is doing. Antonio may be correct in that one SQL statement would probably do it. But without really understanding how the search works it is hard to tell.James
Any clever coders out there
Hi allI think that we can only really offer the best advice if peterg gives an explanation of what his code needs to achieve, how often and when the data changes and the nature of the environment in which this needs to be achieved (eg single PC, LAN or WAN and if WAN what sort of speed)Maybe then an appropriate index (if we are to stay with xBase tables) would mean that 64 seeks would not be required and / or setfilters would not be required. Maybe we can use arrays / hashes. Maybe the pricing table can be cached in memory so table access isn't required at all.SQL can be much more efficient with multiple seeks across a slower link but on a local PC xBase table access using indices can be very efficient.RegardsxProgrammer
Any clever coders out there
Hi allFirstly how do I upload a sample prg and dbf for testing?The price file could be very large > 150K records and could be updated by any number of users during the course of the day so cerating an array is probably not possible.A price can exist for the followingsite (internal identifier)customer type (a group of customer)customerdelivery locationcontainerwaste typedisposal lcoationhaulierdateor any combination of the above with the container being the common factor.The system has to try and find the best possible match before reporting that there are no prices setup. In dbfs this works lightning fast so is not a problem but in sql 64 seeks take way too longAny ideasPeter
Any clever coders out there
Peter,Try to build a SQL query that does it all. Even if you can't, please start writting it here so we can help you, once we understand the exact query that you need
Any clever coders out there
Hi PeterIf your SQL code pretty much follows your xBase code it will be inefficient. SQL is efficient where you "bundle up" the work into a single query. If you have a series of individual "seeks" SQL will be inefficient compared to xBase on a local machine.From what I can see of your case if you need to use SQL you probably need to use a stored procedure. These can be precompiled on many vendor implementations and can be very fast.Whilst I have used SQL in one major project, I am no expert and am not the right person to help you with writing a suitable stored procedure. They do exist although this may not be the best forum to locate them in.I don't know how familiar you are with stored procedures. You could start with:<!-- m --><a class="postlink" href="http://en.wikipedia.org/wiki/Stored_procedure">http://en.wikipedia.org/wiki/Stored_procedure</a><!-- m --><!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/aa174792.aspx">http://msdn.microsoft.com/en-us/library/aa174792.aspx</a><!-- m --><!-- m --><a class="postlink" href="http://www.sql-server-performance.com/articles/dba/stored_procedures_basics_p1.aspx">http://www.sql-server-performance.com/a ... cs_p1.aspx</a><!-- m --><!-- m --><a class="postlink" href="http://databases.about.com/od/sqlserver/a/storedprocedure.htm">http://databases.about.com/od/sqlserver ... cedure.htm</a><!-- m --><!-- m --><a class="postlink" href="http://www.informit.com/articles/article.aspx?p=25288">http://www.informit.com/articles/article.aspx?p=25288</a><!-- m -->The following article outlines some techniques that you may find to be of use.<!-- m --><a class="postlink" href="http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm">http://vyaskn.tripod.com/passing_arrays ... edures.htm</a><!-- m -->And maybe consider registering on<!-- m --><a class="postlink" href="http://searchsqlserver.techtarget.com/loginMembersOnly/1,289498,sid87_gci1197403,00.html?NextURL=http%3A//searchsqlserver.techtarget.com/tip/0%2C289483%2Csid87_gci1197403%2C00.html">http://searchsqlserver.techtarget.com/l ... %2C00.html</a><!-- m -->RegardsxProgrammer
Any clever coders out there
I am not sure where to start but here goesvariable declarationsmSiteID = 1mCustacc = "ABC123"mUniqnbr = "0000000001"mCustType = "EXTERNAL"mContainer = "1100WB"mWaste = "GENERAL"mDisposer = "XYZ987"mDate = DATE()select * from skippricwhere site_id = mSiteID and sp_custno = mcustacc and uniq_nbr = mUniwnbr and sp_contype = mContainer and sp_waste = mWaste andsp_effdate<=mDatebut if this fails then it should test for all other combinations until there is nothing left to test.Once it finds a record then i can use the prices contained in this recordDoes that help?Peter
Any clever coders out there
Peter,Use OR to check for the other combinations from the same SQL sentence
Any clever coders out there
AntonioThis will result in 64 seperate or statements. Do you think this will be fasterPeter
Any clever coders out there
Peter,Can you design your query so that it returns all possible matches to a recordset, then scan the recordset for the best match?James
Any clever coders out there
JamesPossibly but i am not that good at sql. Any ideas wher eot lookThanksPeter
Any clever coders out there
Peter,You should use AND and OR in your SQL statement and your SQL server will optimize it to solve it as fast as possible
Any clever coders out there
Peter,>select * from skippric where site_id = mSiteID and sp_custno = mcustacc and uniq_nbr = mUniwnbr and sp_contype = mContainer and sp_waste = mWaste and sp_effdate<=mDate Isn't the above going to return a recordset? Are all possible matches in this recordset? If not, then can you loosen up the query to include all possible matches?>but if this fails then it should test for all other combinations until there is nothing left to test.What do you mean by other combinations? When is a record acceptable? James
Any clever coders out there
The result should only return one record which should be the best match
Any clever coders out there
Peter,>sp_effdate<=mDate But when you are using something like the above, it would seem there could be multiple records with that criteria.How do you define a best match? What is an acceptable match, and what isn't? I.E. which criteria are musts, and which are not?I am having a hard time grasping what you are doing. I have done some complex pricing schemes before but they were all either matching or not matching; I have never done a best match pricing.James
Any clever coders out there
I have created the following stored procedure which works but is just as slow as 32 seeksAny ideasUse iwscompagoIF OBJECT_ID ('usp_find_price') IS NOT NULL DROP PROCEDURE usp_find_price go CREATE PROCEDURE usp_find_price @mSite numeric(2), @mCustType varchar(10), @mCustNbr varchar(10), @mUniqNbr varchar(10), @mContainer varchar(10), @mWaste varchar(10), @mArea varchar(10), @mDisposer varchar(10), @mEffective datetime, @result numeric (10) AS /*1*/ SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and (uniq_nbr = @mUniqNbr or uniq_nbr is null) and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_region = @mArea or sp_region is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) /*2*/ IF @result = 0SET @result = (SELECT sr_recno from skippricwhere site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and (uniq_nbr = @mUniqNbr or uniq_nbr is null) and sp_contain = @mContainer and(sp_waste = @mWaste or sp_waste is null) and(sp_region = @mArea or sp_region is null) andsp_effdate <= @mEffective and(sp_deldate >= @mEffective or sp_deldate is null))ELSE Return 0/*3*/IF @result = 0SET @result = (SELECT sr_recno from skippricwhere site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and (uniq_nbr = @mUniqNbr or uniq_nbr is null) and sp_contain = @mContainer and(sp_waste = @mWaste or sp_waste is null) and(sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and(sp_deldate >= @mEffective or sp_deldate is null))ELSE Return 0/*4*/IF @result = 0SET @result = (SELECT sr_recno from skippricwhere site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and (uniq_nbr = @mUniqNbr or uniq_nbr is null) and sp_contain = @mContainer and(sp_waste = @mWaste or sp_waste is null) andsp_effdate <= @mEffective and(sp_deldate >= @mEffective or sp_deldate is null))ELSE Return 0/*5*/IF @result = 0SET @result = (SELECT sr_recno from skippricwhere site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and (uniq_nbr = @mUniqNbr or uniq_nbr is null) and sp_contain = @mContainer and(sp_region = @mArea or sp_region is null) and(sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and(sp_deldate >= @mEffective or sp_deldate is null))ELSE Return 0/*6*/IF @result = 0SET @result = (SELECT sr_recno from skippricwhere site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and (uniq_nbr = @mUniqNbr or uniq_nbr is null) and sp_contain = @mContainer and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*7*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and (uniq_nbr = @mUniqNbr or uniq_nbr is null) and sp_contain = @mContainer and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*8*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and (uniq_nbr = @mUniqNbr or uniq_nbr is null) and sp_contain = @mContainer and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 IF @result = 0 /*9*/ SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_region = @mArea or sp_region is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*10*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_region = @mArea or sp_region is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*11*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*12*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*13*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and sp_contain = @mContainer and (sp_region = @mArea or sp_region is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*14*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and sp_contain = @mContainer and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*15*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and sp_contain = @mContainer and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*16*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custno = @mCustNbr or sp_custno is null) and sp_contain = @mContainer and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*17*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custype = @mCustType or sp_custype is null) and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_region = @mArea or sp_region is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*18*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custype = @mCustType or sp_custype is null) and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_region = @mArea or sp_region is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*19*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custype = @mCustType or sp_custype is null) and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*20*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custype = @mCustType or sp_custype is null) and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*21*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custype = @mCustType or sp_custype is null) and sp_contain = @mContainer and (sp_region = @mArea or sp_region is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*22*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custype = @mCustType or sp_custype is null) and sp_contain = @mContainer and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*23*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custype = @mCustType or sp_custype is null) and sp_contain = @mContainer and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*24*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and (sp_custype = @mCustType or sp_custype is null) and sp_contain = @mContainer and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*25*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_region = @mArea or sp_region is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*26*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_region = @mArea or sp_region is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*27*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*28*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and sp_contain = @mContainer and (sp_waste = @mWaste or sp_waste is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*29*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and sp_contain = @mContainer and (sp_region = @mArea or sp_region is null) and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*30*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and sp_contain = @mContainer and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*31*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and sp_contain = @mContainer and (sp_dispsit = @mDisposer or sp_dispsit is null) and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) ELSE Return 0 /*32*/ IF @result = 0 SET @result = (SELECT sr_recno from skippric where site_id = @msite and sp_contain = @mContainer and sp_effdate <= @mEffective and (sp_deldate >= @mEffective or sp_deldate is null)) RETURN @result
Any clever coders out there
Hi allI have recoded the function using arrays to store the seek definition and then a series of IF/THEN conditions to test each of the seek definitions prior to actually seeking in the table.This has resulted in an 8 fold increase in speed and is now as fast in sql as it was in dbf (and of course it is now 8 times faster in dbf)Many thanks for all of your help and pointing me in the direction of arraysPeter
Any clever coders out there
You're welcome. Glad it works for you. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Any desired / missing tests for xBrowse ( wishlist ) ?
Hello,I added another Folder-page to the xBrowse-tools.[img:yrkn7iro]http&#58;//www&#46;pflegeplus&#46;com/pictures/Browset7&#46;jpg[/img:yrkn7iro]Now ( because of all the possible tests / settings ) i'm not shure,if something still missing or desired. i can still add any needed tests / settings.If you have any wishes, just tell me.A overview of Page 1 - 4Page 1[img:yrkn7iro]http&#58;//www&#46;pflegeplus&#46;com/pictures/Setting1&#46;jpg[/img:yrkn7iro]Page 2[img:yrkn7iro]http&#58;//www&#46;pflegeplus&#46;com/pictures/Setting2&#46;jpg[/img:yrkn7iro]Page 3[img:yrkn7iro]http&#58;//www&#46;pflegeplus&#46;com/pictures/Setting3&#46;jpg[/img:yrkn7iro]Page 4[img:yrkn7iro]http&#58;//www&#46;pflegeplus&#46;com/pictures/Setting4&#46;jpg[/img:yrkn7iro]Regardsuwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Any experience with voice command and FWH?
Is possible, maybe through ActiveX, use FWH to develop an application to interact with users by using voice command? George
Any experience with voice command and FWH?
Seems that no member of this forum have experienced with SAPI + FWH. That is to control our programs by "Command of Voice" instead of using the keyboard or the "mouse." See below some links regarding this topic: <!-- m --><a class="postlink" href="http://www.microsoft.com/downloads/deta">http://www.microsoft.com/downloads/deta</a><!-- m --> ... laylang=en <!-- m --><a class="postlink" href="http://www.research-lab.com/sedllread.htm">http://www.research-lab.com/sedllread.htm</a><!-- m --> <!-- m --><a class="postlink" href="http://www.em-t.com/Free-Voice-Recognit">http://www.em-t.com/Free-Voice-Recognit</a><!-- m --> ... -s/223.htm <!-- m --><a class="postlink" href="http://www.nuance.com/naturallyspeaking">http://www.nuance.com/naturallyspeaking</a><!-- m --> ... client.asp <!-- m --><a class="postlink" href="http://cslu.cse.ogi.edu/HLTsurvey/ch1node4.html">http://cslu.cse.ogi.edu/HLTsurvey/ch1node4.html</a><!-- m --> George
Any experience with voice command and FWH?
Hi Silvio, You mean a FWH class to give instruction by Command Voice? Where is that class? I need, by example, when I say 'Send' open dialog in my program and fill the fields by Command Voices instead of using the keyboard. Would be this possible using SAPI and FWH? Regards, George
Any experience with voice command and FWH?
there is also a fwh class
Any function to create nested folders at one go?
Hi guys, To clarify, if I need a folder called c:\my program\data\backup, the function will auto create My Program, Data and Backup as necessary. TIA
Any function to create nested folders at one go?
[code=fw:1viimvgg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <shlobj.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">HB_FUNC</span> <span style="color: #000000;">&#40;</span>SHCREATEDIRECTORY<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   hb_retni<span style="color: #000000;">&#40;</span> SHCreateDirectoryEx<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NULL</span>, hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">NULL</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:1viimvgg] In you application, use the function ShCreateDirectory( <cFullPath> ) Return value indicates success. Link shell32.lib with application. You may even declare this as DLL function.
Any function to create nested folders at one go?
Thanks Rao <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Any function to create nested folders at one go?
Hi, Rao. Can you post a sample, please?
Any function to create nested folders at one go?
Rao, Please ignore the previous post. I already did it. Thanks.
Any function to create nested folders at one go?
Would you be so kind to post the answer. Best regards, Otto
Any function to create nested folders at one go?
As Rao said, we must link shell32.lib with our aplication. (Shell32.Lib is in the Borland directory) //------------------ Function Prueba() local cDirDest := "C:\FRANCISCO\DOCUMENTOS\DIVERSOS\" ShCreateDirectory( cDirDest ) Return Nil #pragma BEGINDUMP #include <shlobj.h> #include <hbapi.h> HB_FUNC (SHCREATEDIRECTORY) { hb_retni( SHCreateDirectoryEx( NULL, hb_parc( 1 ), NULL ) ); } #pragma ENDDUMP Saludos.
Any guide on creating DPI-aware apps?
Hi guys, Anyone has any tips, gotchas to share in regards of creating FWH apps that are dpi-aware? I only realize the problem after a couple of our customers complained that they can't navigate to the end of my scrollable dialog. I've bookmarked <!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd464660(v=vs.85">http://msdn.microsoft.com/en-us/library ... 60(v=vs.85</a><!-- m -->).aspx for reading later but for now I need to solve the scrollable dialog part first. Using fwh\samples\testdscr_.prg, this is what I get after I changed to 120dpi and trying to navigate using the scrollbar to the bottom: [img:3n7n18hs]http&#58;//img213&#46;imageshack&#46;us/img213/3675/120dpi&#46;jpg[/img:3n7n18hs] This is what should be seen: [img:3n7n18hs]http&#58;//img36&#46;imageshack&#46;us/img36/1584/10213083&#46;jpg[/img:3n7n18hs] So how should testdscr_.prg be modified to make it behave correctly irregardless what's the dpi (user can set the dpi to other than 96 or 120)? TIA
Any guide on creating DPI-aware apps?
Got another interface issue. When user run our program on a more recent notebook pre-installed with Win7, the placement of controls on dialogs went crazy. After some googling I suspect this is due to Win7's so called dpi-virtualization. Read something about preparing a manifest that tell Win7 that an exe is already dpi-aware so don't auto-scale it. Will let you guys know the outcome once I could get my hand on a Win7 notebook
Any guide on creating DPI-aware apps?
Hua, Thanks for your feedback! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Any guide on creating DPI-aware apps?
Hua, Have you tried to automatically calculate it based on the oDlg:nHeight value ? I think that in these lines: [code=fw:2feothid]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ; <br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oScrDlg := TScrDlg<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">1</span>, <span style="color: #000000;">65</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">70</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">560</span>, <span style="color: #000000;">550</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Center</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />&nbsp;</div>[/code:2feothid] 550 + 65 should be equal to oDlg:nHeight
Any guide on creating DPI-aware apps?
Hi, Out of curiosity, I just tested TESTDSCR_.PRG. I set the DPI to 120 and changed D_HEIGHT to 18 from 13 [code=fw:3jqcy58p]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#define</span> D_HEIGHT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">18</span> <span style="color: #B900B9;">//13</span><br />&nbsp;</div>[/code:3jqcy58p] Then it worked perfectly. To automatically calculate D_HEIGHT define, we need to know what is the current DPI Setting. Based on that we can set the correct D_HEIGHT, which enables correct display of Scrollable Dialog. Mr.Antonio, Is there any such function to know the current DPI Setting ? Regards, - Ramesh Babu P
Any guide on creating DPI-aware apps?
Ramesh, [url:27ptt35k]http&#58;//msdn&#46;microsoft&#46;com/en-us/library/ms701681(v=vs&#46;85)&#46;aspx[/url:27ptt35k] [quote:27ptt35k]To get the system dpi setting, use the CDC::GetDeviceCaps function with the LOGPIXELSX flag. If you do not cancel dpi scaling, this call returns the default value of 96 dpi.[/quote:27ptt35k] So it should be: #define LOGPIXELSX 88 local hDC := GetDC( 0 ) MsgInfo( GetDeviceCaps( hDC, LOGPIXELSX ) ) ReleaseDC( 0, hDC )
Any guide on creating DPI-aware apps?
Mr.Antonio, Thanks for your valuable suggestion, I have tested the following code not only with 96 and 120 DPIs but also with various DPIs and found to be working well. [url=http&#58;//imageshack&#46;us/photo/my-images/6/144dpi&#46;jpg/:1tw84avy][img:1tw84avy]http&#58;//img6&#46;imageshack&#46;us/img6/8127/144dpi&#46;jpg[/img:1tw84avy][/url:1tw84avy] [code=fw:1tw84avy]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">// Testing how to scroll a dialog with its contents </span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span> <br /><br />*<span style="color: #00D7D7;">#define</span> d_width           <span style="color: #000000;">4</span> <br />*<span style="color: #00D7D7;">#define</span> d_height         <span style="color: #000000;">18</span><br /><br /><span style="color: #00D7D7;">#define</span> LOGPIXELSX        <span style="color: #000000;">88</span><br /><br /><span style="color: #00C800;">STATIC</span> d_width := <span style="color: #000000;">4</span>, d_height := <span style="color: #000000;">13</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />   <span style="color: #00C800;">LOCAL</span> oDlg, oScrDlg<br /><br />   <span style="color: #00C800;">local</span> hDC  := GetDC<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"dlgComScroll"</span> ;  <br />         <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Scroll dialog"</span>            ; <br />         <span style="color: #0000ff;">STYLE</span> nOR<span style="color: #000000;">&#40;</span> WS_VSCROLL, WS_HSCROLL <span style="color: #000000;">&#41;</span> <br /><br />   oDlg:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">&#123;</span> | nKey, nDelta, nXPos, nYPos | MouseWheel<span style="color: #000000;">&#40;</span> nKey, nDelta, nXPos, nYPos, oScrDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ; <br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> Set_D_Height<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oScrDlg := TScrDlg<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg, <span style="color: #000000;">1</span>, <span style="color: #000000;">65</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">70</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">560</span>, <span style="color: #000000;">550</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #0000ff;">Center</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><br /><br /><span style="color: #00C800;">function</span> MouseWheel<span style="color: #000000;">&#40;</span> nKey, nDelta, nXPos, nYPos, oScrDlg <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oVScroll := oScrDlg:<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span><br /><br />   <span style="color: #00C800;">if</span> nDelta < <span style="color: #000000;">0</span><br />      oVScroll:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      oVScroll:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span>      <br /><br />   oScrDlg:<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//============================================================================ </span><br /><span style="color: #B900B9;">// FUNCTION : Set_D_Height() </span><br /><span style="color: #B900B9;">// Purpose  : To Set new d_height for the Scroll bar</span><br /><span style="color: #B900B9;">//============================================================================ </span><br /><br />PROCEDURE Set_D_Height<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> nDpi := GetCurrentDpi<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />d_height := <span style="color: #000000;">&#40;</span>nDpi * <span style="color: #000000;">13</span> / <span style="color: #000000;">96</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <br /><br /><span style="color: #B900B9;">//============================================================================ </span><br /><span style="color: #B900B9;">// FUNCTION : GetCurrentDpi() </span><br /><span style="color: #B900B9;">// Purpose  : To Get the Windows Current DPI Setting </span><br /><span style="color: #B900B9;">//============================================================================ </span><br /><br /><span style="color: #00C800;">FUNCTION</span> GetCurrentDpi<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">local</span> hDc  := GetDc<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> nDpi := GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, LOGPIXELSX <span style="color: #000000;">&#41;</span><br /><br />nDpi := GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, LOGPIXELSX <span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> LTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nDpi<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" DPI"</span> <span style="color: #000000;">&#41;</span><br /><br />ReleaseDC<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, hDC <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> nDpi<br /><br /><span style="color: #B900B9;">//============================================================================ </span><br /><span style="color: #B900B9;">// FileName : SCROLL.PRG </span><br /><span style="color: #B900B9;">// Purpose  :  dialog Scroll Class </span><br /><span style="color: #B900B9;">// Author   : Eric Yang </span><br /><span style="color: #B900B9;">// Update History : </span><br /><span style="color: #B900B9;">//      Date     Contents </span><br /><span style="color: #B900B9;">//    ---------- --------------------------------------------------------------- </span><br /><span style="color: #B900B9;">//    1997.02.01 </span><br /><span style="color: #B900B9;">//    2006.29.12 By Rossini - Brasil </span><br /><span style="color: #B900B9;">//============================================================================ </span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span> <br /><br />#ifndef <span style="color: #00C800;">TRUE</span> <br />   <span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">TRUE</span>              .T. <br />   <span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">FALSE</span>             .F. <br />#endif <br /><br /><span style="color: #00C800;">CLASS</span> TScrDlg <br /><br />   <span style="color: #00C800;">DATA</span> oDlg <br />   <span style="color: #00C800;">DATA</span> nVPos, nHPos <br /><br />   <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg,nV1,nV2,nH1,nH2 <span style="color: #000000;">&#41;</span> CONSTRUCTOR <br />   <span style="color: #00C800;">METHOD</span> SetScroll<span style="color: #000000;">&#40;</span> nV1,nV2,nH1,nH2 <span style="color: #000000;">&#41;</span> <br /><br />   <span style="color: #B900B9;">//-*------------------------------------------------------------ </span><br />   <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">VScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> VScrollThumb<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> VScrollTrack<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> VScrollPgDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> VScrollPgUp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />   <span style="color: #B900B9;">//-*----------------------------- </span><br />   <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">HScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> HScrollThumb<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> HScrollTrack<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> HScrollPgDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> HScrollPgUp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">ENDCLASS</span> <br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg,nV1,nV2,nH1,nH2 <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br />   ::<span style="color: #000000;">nVPos</span> := <span style="color: #000000;">0</span> <br />   ::<span style="color: #000000;">nHPos</span> := <span style="color: #000000;">0</span> <br />   ::<span style="color: #000000;">oDlg</span>  := oDlg <br />   ::<span style="color: #000000;">SetScroll</span><span style="color: #000000;">&#40;</span> nV1,nV2,nH1,nH2 <span style="color: #000000;">&#41;</span> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span> <br /><br /><span style="color: #00C800;">METHOD</span> SetScroll<span style="color: #000000;">&#40;</span> nV1,nV2,nH1,nH2 <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br /><span style="color: #00C800;">LOCAL</span> aCoors1:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>,aCoors2:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span> <br />   <span style="color: #B900B9;">//-------------------------------------------------- </span><br />   <span style="color: #B900B9;">//-* Vertical Scroll Bar </span><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span> != <span style="color: #00C800;">NIL</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">SetRange</span><span style="color: #000000;">&#40;</span> nV1,nV2 <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nVPos</span> := ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">GetPos</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bGoDown</span>   := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bGoUp</span>     := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bPageUp</span>   := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #000000;">VScrollPgUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bPageDown</span> := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #000000;">VScrollPgDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bGoTop</span>    := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bGoBottom</span> := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nPgStep</span>   := <span style="color: #000000;">10</span> <br />      <span style="color: #B900B9;">//::oDlg:oVScroll:lReDraw := TRUE </span><br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bPos</span>      := <span style="color: #000000;">&#123;</span>|nPos| ::<span style="color: #000000;">VScrollThumb</span><span style="color: #000000;">&#40;</span>nPos<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bTrack</span>    := <span style="color: #000000;">&#123;</span>|nPos| ::<span style="color: #000000;">VScrollTrack</span><span style="color: #000000;">&#40;</span>nPos<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />   <span style="color: #00C800;">endif</span> <br />   <span style="color: #B900B9;">//-------------------------------------------------- </span><br />   <span style="color: #B900B9;">//-* Horizontal Scroll Bar </span><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span> != <span style="color: #00C800;">NIL</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">SetRange</span><span style="color: #000000;">&#40;</span> nH1,nH2 <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nHPos</span> := ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">GetPos</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bGoDown</span>   := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #0000ff;">HScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bGoUp</span>     := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #0000ff;">HScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bPageUp</span>   := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #000000;">HScrollPgUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bPageDown</span> := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #000000;">HScrollPgDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bGoTop</span>    := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #0000ff;">HScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bGoBottom</span> := <span style="color: #000000;">&#123;</span>|| ::<span style="color: #0000ff;">HScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nPgStep</span>   := <span style="color: #000000;">10</span> <br />    <span style="color: #B900B9;">//::oDlg:oHScroll:lReDraw   := TRUE </span><br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bPos</span>      := <span style="color: #000000;">&#123;</span>|nPos| ::<span style="color: #000000;">HScrollThumb</span><span style="color: #000000;">&#40;</span>nPos<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bTrack</span>    := <span style="color: #000000;">&#123;</span>|nPos| ::<span style="color: #000000;">HScrollTrack</span><span style="color: #000000;">&#40;</span>nPos<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />   <span style="color: #00C800;">endif</span> <br />*   ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">bKeyChar</span> := <span style="color: #000000;">&#123;</span>|nKey,nFlags| ScrollKey<span style="color: #000000;">&#40;</span>nKey<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />   <span style="color: #B900B9;">//-------------------------------------------------- </span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><span style="color: #B900B9;">/*<br />STATIC FUNCTION ScrollKey(nKey) <br /><br />   MsgInfo( "Key : "+str(nKey,10) ) <br /><br />   //if nKey == K_ENTER <br />   //   goMainDlg:End() <br />   //   lRetVal := TRUE <br />   //endif <br />RETURN( NIL ) <br />*/</span><br /><br /><span style="color: #B900B9;">//================================================================= </span><br /><span style="color: #B900B9;">//-* Vertical Scroll Bar </span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">VScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br /><span style="color: #00C800;">LOCAL</span> nNewPos <br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span>   ; <br />      .and. ::<span style="color: #000000;">nVPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span> <br />      nNewPos := ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">GetPos</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>,  ; <br />         <span style="color: #000000;">&#40;</span>  ::<span style="color: #000000;">nVPos</span>-nNewPos <span style="color: #000000;">&#41;</span>*d_height,    ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nVPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">METHOD</span> VScrollThumb<span style="color: #000000;">&#40;</span>nNewPos<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span>   ; <br />      .and. ::<span style="color: #000000;">nVPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span>nNewPos<span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>,  ; <br />         <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nVPos</span> - nNewPos <span style="color: #000000;">&#41;</span>*d_height,    ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nVPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">METHOD</span> VScrollTrack<span style="color: #000000;">&#40;</span>nNewPos<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span>   ; <br />      .and. ::<span style="color: #000000;">nVPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span>nNewPos<span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>,  ; <br />         <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nVPos</span> - nNewPos <span style="color: #000000;">&#41;</span>*d_height,    ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nVPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">METHOD</span> VScrollPgDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br /><span style="color: #00C800;">LOCAL</span> nNewPos <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> < ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span> <br />      nNewPos := ::<span style="color: #000000;">nVPos</span> + ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nPgStep</span> <br />      nNewPos := iif<span style="color: #000000;">&#40;</span>nNewPos > ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span>, ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span>, nNewPos<span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>,  ; <br />         <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nVPos</span> - nNewPos <span style="color: #000000;">&#41;</span>*d_height,    ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nVPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">METHOD</span> VScrollPgUp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br /><span style="color: #00C800;">LOCAL</span> nNewPos <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> > ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span> <br />      nNewPos := ::<span style="color: #000000;">nVPos</span> - ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nPgStep</span> <br />      nNewPos := iif<span style="color: #000000;">&#40;</span>nNewPos < ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span>,::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span>,nNewPos<span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>,  ; <br />         <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nVPos</span> - nNewPos <span style="color: #000000;">&#41;</span>*d_height,    ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nVPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #B900B9;">//================================================================= </span><br /><span style="color: #B900B9;">//-* Horizontal Scroll Bar </span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">HScroll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br /><span style="color: #00C800;">LOCAL</span> nNewPos <br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span>   ; <br />      .and. ::<span style="color: #000000;">nHPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span> <br />      nNewPos := ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">GetPos</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>,           ; <br />         <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">&#41;</span>*d_width,<span style="color: #000000;">0</span>,   ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nHPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">METHOD</span> HScrollThumb<span style="color: #000000;">&#40;</span>nNewPos<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span>   ; <br />      .and. ::<span style="color: #000000;">nHPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span>nNewPos<span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>,           ; <br />         <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">&#41;</span>*d_width,<span style="color: #000000;">0</span>,   ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nHPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">METHOD</span> HScrollTrack<span style="color: #000000;">&#40;</span>nNewPos<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span>   ; <br />      .and. ::<span style="color: #000000;">nHPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span> <br />      ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span>nNewPos<span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>,           ; <br />         <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">&#41;</span>*d_width,<span style="color: #000000;">0</span>,   ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nHPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">METHOD</span> HScrollPgDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br /><br /><span style="color: #00C800;">LOCAL</span> nNewPos <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> < ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span> <br />      nNewPos := ::<span style="color: #000000;">nHPos</span> + ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nPgStep</span> <br />      nNewPos := iif<span style="color: #000000;">&#40;</span>nNewPos > ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span>, ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span>, nNewPos<span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>,           ; <br />         <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">&#41;</span>*d_width,<span style="color: #000000;">0</span>,  ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nHPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">METHOD</span> HScrollPgUp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TScrDlg <br /><span style="color: #00C800;">LOCAL</span> nNewPos <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> > ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span> <br />      nNewPos := ::<span style="color: #000000;">nHPos</span> - ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nPgStep</span> <br />      nNewPos := iif<span style="color: #000000;">&#40;</span>nNewPos < ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span>,::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span>,nNewPos<span style="color: #000000;">&#41;</span> <br />      SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />      ScrollWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>,           ; <br />         <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">&#41;</span>*d_width,<span style="color: #000000;">0</span>,  ; <br />         <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />      ::<span style="color: #000000;">nHPos</span> := nNewPos <br />   <span style="color: #00C800;">endif</span> <br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #B900B9;">//=* End of File ================================================= </span><br /><br /><span style="color: #B900B9;">//#include "wndscrol.c"</span><br /><br /> </div>[/code:1tw84avy] I request our members to test it further, on different Windows OS environments. I have tested this on Windows XP, Service Pack 2 Regards, - Ramesh Babu P
Any guide on creating DPI-aware apps?
Hi Members, It would be nice if the cursor is moved up/down based on pressing TAB or SHIFT+TAB or ENTER key to go down, accordingly scroll bar automatically moved upwards or downwards and the current get is visible. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> I request the members who are all using this Scrollable Dialogue Class to try it. Regards, - Ramesh Babu P
Any guide on creating DPI-aware apps?
Ramesh, Very good! Thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Any guide on creating DPI-aware apps?
Thank you for the prompt reply Antonio. Sorry for the late reply, was dragged to solve something that was deemed higher priority by management. Ramesh, thank you! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> I'm gonna try your solution now. [quote="RAMESHBABU":xy9zb3em]It would be nice if the cursor is moved up/down based on pressing TAB or SHIFT+TAB or ENTER key to go down, accordingly scroll bar automatically moved upwards or downwards and the current get is visible. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> [/quote:xy9zb3em] I agree with you on this
Any guide on creating DPI-aware apps?
I find the following tutorial has been quite useful: <!-- m --><a class="postlink" href="http://www.rw-designer.com/DPI-aware">http://www.rw-designer.com/DPI-aware</a><!-- m -->
Any infos about function < C5RoundRect > ? ( solved )
Hello, I tested the function [color=#0000FF:3aj8cnx6][b:3aj8cnx6]C5RoundRect[/b:3aj8cnx6][/color:3aj8cnx6] but couldn't find anything about possible alterations to change the backgroundcolor or maybe to make it transparent inside. The circle itself, is the selected pencolor and size. Where does this function come from ? A test, merged to a image [img:3aj8cnx6]http&#58;//www&#46;pflegeplus&#46;com/pictures/round3&#46;jpg[/img:3aj8cnx6] A sample of usage ( merging different objects : alphablended bmp and free text ) It is possible to change the form from circle to rounded box or ellipse [img:3aj8cnx6]http&#58;//www&#46;pflegeplus&#46;com/pictures/round4&#46;jpg[/img:3aj8cnx6] another combination a inserted, created signature, a selected image with a added box ( defined pensize and color ). the pensize and color can be changed at runtime. [img:3aj8cnx6]http&#58;//www&#46;pflegeplus&#46;com/pictures/round5&#46;jpg[/img:3aj8cnx6] Best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Any infos about function < C5RoundRect > ? ( solved )
Uwe, That function is just a wrapper for the Windows API function RoundRect() In order to use a brush with it, you should first create the brush and select it to the current hDC and later on, save the current brush using hOldBrush := SelectObject( hDC, oBrush:hBrush ), paint, select the previous brush with SelectObject( hDC, hOldBrush ) and finally destroy the brush ( oBrush:End() )
Any infos about function < C5RoundRect > ? ( solved )
Antonio, THANK YOU VERY MUCH ! it works fine that way. Now I understand the logic. it can be a brush-combination : DEFINE BRUSH oBrush1 STYLE NULL DEFINE BRUSH oBrush2 COLOR 255 with some calculations, it will be possible, to get some nice effects. I will add four possible forms : 1. round filled ( mouseclick Top / Left for position and a defined size ) 2. free form filled ( mouseclick Top / Left and Bottom / Right ) 3. round transparent 4. free form transparent the sample shows a inserted alphablended image The three textlines are converted from a multiline get. [img:2s1k98lo]http&#58;//www&#46;pflegeplus&#46;com/pictures/round6&#46;jpg[/img:2s1k98lo] 17 possible styles : [img:2s1k98lo]http&#58;//www&#46;pflegeplus&#46;com/pictures/round7&#46;jpg[/img:2s1k98lo] Best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->