FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Dialogo con esquinas redondas
Posts: 485
Joined: Fri Feb 09, 2007 10:34 AM
Dialogo con esquinas redondas
Posted: Tue May 03, 2011 05:40 PM

Muy buenas foro, estoy siempre intentando hacer un dialgo con una imagen de fondo, cuyas esquinas estΓ‘n redondeadas, entonces quiero que se vea la imagen como si fuera el dialogo.

ΒΏMe podeis decir como hacer esto?

Un Saludo.

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: Dialogo con esquinas redondas
Posted: Wed May 04, 2011 12:33 AM

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Dialogo con esquinas redondas
Posted: Wed May 04, 2011 03:56 AM
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg, oBrush, oFont
   local nVar  := 100

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE BRUSH oBrush FILENAME "\fwh\bitmaps\olga1.jpg"

   DEFINE DIALOG oDlg SIZE 300,400 PIXEL ;
      TITLE "Image Dialog" ;
      BRUSH oBrush FONT oFont TRANSPARENT

   @ 10,10 SAY "This is some Text" SIZE 80,12 PIXEL OF oDlg ;
      COLOR CLR_WHITE,CLR_BLACK TRANSPARENT

   @ 30,10 GET nVar PICTURE "999,999.99" SIZE 80,12 PIXEL OF oDlg RIGHT

   @ 180,100 BUTTON "Close" SIZE 40,14 PIXEL OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE BRUSH oBrush
   RELEASE FONT  oFont

return nil


Result:
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Dialogo con esquinas redondas
Posted: Wed May 04, 2011 06:05 AM
Image only with round corners, without title and sysmenu.
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg, oBrush, oFont
   local nVar  := 100

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE BRUSH oBrush FILENAME "\fwh\bitmaps\olga1.jpg"

   DEFINE DIALOG oDlg SIZE 300,400 PIXEL ;
      TITLE "Image Dialog" ;
      STYLE WS_POPUP ;
      BRUSH oBrush FONT oFont TRANSPARENT

   @ 10,10 SAY "This is some Text" SIZE 80,12 PIXEL OF oDlg ;
      COLOR CLR_WHITE,CLR_BLACK TRANSPARENT

   @ 30,10 GET nVar PICTURE "999,999.99" SIZE 80,12 PIXEL OF oDlg RIGHT

   @ 180,100 BUTTON "Close" SIZE 40,14 PIXEL OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT RoundCorners( oDlg )

   RELEASE BRUSH oBrush
   RELEASE FONT  oFont

return nil

static function RoundCorners( oDlg )

   local aRect, hRgn

   aRect       := GetClientRect( oDlg:hWnd )
   hRgn        := CreateRoundRectRgn( aRect, 40, 40 )
   SetWindowRgn( oDlg:hWnd, hRgn )
   DeleteObject( hRgn )

return nil


Result


These two samples are simpler and easier to use.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Re: Dialogo con esquinas redondas
Posted: Wed May 04, 2011 07:23 AM

N,

Nice example -> Thanks !!! :D

Salutacions, saludos, regards

"...programar es fΓ‘cil, hacer programas es difΓ­cil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 625
Joined: Wed Mar 14, 2007 06:49 PM
Re: Dialogo con esquinas redondas
Posted: Wed May 04, 2011 05:42 PM
Saludos a Todos:

Se ve interesante, la curiosidad me mato y quise probarlo pero me faltaban 2 funciones CreateRoundRectRgn() que ya encontre, pero me falta esta otra SetWindowRgn(), :-) :-) Si fuera posible publicar el codigo de Γ©sta funcion se los agradeceria.

Gracias... :-)
Soluciones y DiseΓ±o de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y DiseΓ±ador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Dialogo con esquinas redondas
Posted: Wed May 04, 2011 05:57 PM
Saludos

Code (fw): Select all Collapse
#pragma BEGINDUMP

HB_FUNC( SETWINDOWRGN )
{
  hb_retnl( SetWindowRgn( ( HWND ) hb_parnl( 1 ), ( HRGN ) hb_parnl( 2 ), TRUE ) );
}

#pragma ENDDUMP
Posts: 625
Joined: Wed Mar 14, 2007 06:49 PM
Re: Dialogo con esquinas redondas
Posted: Wed May 04, 2011 06:17 PM

Hola Daniel:

Gracias por responder pronto a mi solicitud, pero creo que estoy bastante desactualizado, Compila sin problemas pero al lanzar el EXE me lanza un MsgStop de error con el Titulo:

Unrecoverable error 9009.

Ni modos.. no pude probarlo..

Gracias de todas maneras.. :roll: :oops:

Soluciones y DiseΓ±o de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y DiseΓ±ador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
Posts: 139
Joined: Fri Nov 25, 2005 04:38 PM
Re: Dialogo con esquinas redondas
Posted: Sat May 07, 2011 06:15 PM

es pssivel, haga clic en la imagen y arrastre la pantalla

Ronaldo Minacapelli
Sistemas, Hospedagem e CriaΓ§Γ£o de WebSites
http://www.bazevani.com.br
Posts: 990
Joined: Wed Oct 19, 2005 02:17 PM
Re: Dialogo con esquinas redondas
Posted: Fri May 13, 2011 10:24 AM

Hi nageswaragunupudi, Daniel,

compiling the sample:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ FiveWin for Harbour 11.03 - Mar. 2011 Harbour development power β”‚β–„
β”‚ (c) FiveTech, 1993-2011 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7 β”‚β–ˆ
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β–ˆ
Β  β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€
Compiling...
Harbour 2.1.0beta1 (Rev. 14559)
Copyright (c) 1999-2010, http://www.harbour-project.org/
Compiling 'prueba.prg' and generating preprocessed output to 'prueba.ppo'...
Lines 3837, Functions/Procedures 2
Generating C source output to 'prueba.c'... Done.
Embarcadero C++ 6.30 for Win32 Copyright (c) 1993-2010 Embarcadero Technologies,
Inc.
prueba.c:
Error E2451 prueba.prg 47: Undefined symbol 'HWND' in function HB_FUN_SETWINDOWR
GN
Error E2121 prueba.prg 47: Function call missing ) in function HB_FUN_SETWINDOWR
GN
*** 2 errors in Compile ***
* Linking errors *

Thanks a lot !!!

Best regards,

Felix

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Dialogo con esquinas redondas
Posted: Fri May 13, 2011 10:36 AM

Hello

in your C code, do you have

include <windows.h> ??

Posts: 990
Joined: Wed Oct 19, 2005 02:17 PM
Re: Dialogo con esquinas redondas
Posted: Fri May 13, 2011 10:55 AM
Daniel,

sΓ³lo he utilizado el ejemplo que estΓ‘ publicado en el post:

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg, oBrush, oFont
   local nVar  := 100

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE BRUSH oBrush FILENAME "Anboto.bmp"

   DEFINE DIALOG oDlg SIZE 300,400 PIXEL ;
      TITLE "Image Dialog" ;
      STYLE WS_POPUP ;
      BRUSH oBrush FONT oFont TRANSPARENT

   @ 10,10 SAY "This is some Text" SIZE 80,12 PIXEL OF oDlg ;
      COLOR CLR_WHITE,CLR_BLACK TRANSPARENT

   @ 30,10 GET nVar PICTURE "999,999.99" SIZE 80,12 PIXEL OF oDlg RIGHT

   @ 180,100 BUTTON "Close" SIZE 40,14 PIXEL OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT RoundCorners( oDlg )

   RELEASE BRUSH oBrush
   RELEASE FONT  oFont

return nil


static function RoundCorners( oDlg )

   local aRect, hWnd, hRgn

   aRect       := GetClientRect( oDlg:hWnd )
   hRgn        := CreateRoundRectRgn( aRect, 40, 40 )
   SetWindowRgn( oDlg:hWnd, hRgn )
   DeleteObject( hRgn )

return nil

#pragma BEGINDUMP

HB_FUNC( SETWINDOWRGN )
{
  hb_retnl( SetWindowRgn( ( HWND ) hb_parnl( 1 ), ( HRGN ) hb_parnl( 2 ), TRUE ) );
}

#pragma ENDDUMP


Muchas gracias.

Saludos,
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Re: Dialogo con esquinas redondas
Posted: Fri May 13, 2011 11:15 AM
B,

AΓ±ade los includes...

Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <Windows.h>
#include <ClipApi.h>


HB_FUNC( SETWINDOWRGN )
{
Β  hb_retnl( SetWindowRgn( ( HWND ) hb_parnl( 1 ), ( HRGN ) hb_parnl( 2 ), TRUE ) );
}

#pragma ENDDUMP
Salutacions, saludos, regards

"...programar es fΓ‘cil, hacer programas es difΓ­cil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 990
Joined: Wed Oct 19, 2005 02:17 PM
Re: Dialogo con esquinas redondas
Posted: Fri May 13, 2011 11:21 AM
Carles,

moltes gracies !!!

Code (fw): Select all Collapse
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ FiveWin for Harbour 11.03 - Mar. 2011           Harbour development power  β”‚β–„
β”‚ (c) FiveTech, 1993-2011     for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7 β”‚β–ˆ
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β–ˆ
Β  β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€
Compiling...
Harbour 2.1.0beta1 (Rev. 14559)
Copyright (c) 1999-2010, http://www.harbour-project.org/
Compiling 'prueba.prg' and generating preprocessed output to 'prueba.ppo'...
Lines 3839, Functions/Procedures 2
Generating C source output to 'prueba.c'... Done.
Embarcadero C++ 6.30 for Win32 Copyright (c) 1993-2010 Embarcadero Technologies,
 Inc.
prueba.c:
Warning W8065 prueba.prg 49: Call to function 'hb_parnl' with no prototype in fu
nction HB_FUN_SETWINDOWRGN
Warning W8065 prueba.prg 49: Call to function 'hb_parnl' with no prototype in fu
nction HB_FUN_SETWINDOWRGN
Warning W8065 prueba.prg 49: Call to function 'hb_retnl' with no prototype in fu
nction HB_FUN_SETWINDOWRGN
Turbo Incremental Link 6.10 Copyright (c) 1997-2010 Embarcadero Technologies, In
c.
* Application successfully built *


Saludos,
Posts: 990
Joined: Wed Oct 19, 2005 02:17 PM
Re: Dialogo con esquinas redondas
Posted: Fri May 13, 2011 11:22 AM
Carles,

el resultado anterior sin

Code (fw): Select all Collapse
#include <ClipApi.h>


Saludos,