Dialogo con esquinas redondas

Dialogo con esquinas redondas

Postby softruz » Tue May 03, 2011 5: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.
softruz
 
Posts: 485
Joined: Fri Feb 09, 2007 10:34 am

Re: Dialogo con esquinas redondas

Postby Bayron » Wed May 04, 2011 12:33 am

=====>

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

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Dialogo con esquinas redondas

Postby nageswaragunupudi » Wed May 04, 2011 3:56 am

Code: Select all  Expand view
#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:
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10316
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dialogo con esquinas redondas

Postby nageswaragunupudi » Wed May 04, 2011 6:05 am

Image only with round corners, without title and sysmenu.
Code: Select all  Expand view
#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
Image

These two samples are simpler and easier to use.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10316
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dialogo con esquinas redondas

Postby Carles » Wed May 04, 2011 7: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
Skype -> https://join.skype.com/cnzQg3Kr1dnk
User avatar
Carles
 
Posts: 1114
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona

Re: Dialogo con esquinas redondas

Postby cuatecatl82 » Wed May 04, 2011 5: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(), :oops: :oops: Si fuera posible publicar el codigo de ésta funcion se los agradeceria.

Gracias... :wink:
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
User avatar
cuatecatl82
 
Posts: 625
Joined: Wed Mar 14, 2007 6:49 pm
Location: San Cristobal de las Casas, Chiapas México

Re: Dialogo con esquinas redondas

Postby Daniel Garcia-Gil » Wed May 04, 2011 5:57 pm

Saludos

Code: Select all  Expand view
#pragma BEGINDUMP

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

#pragma ENDDUMP
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Dialogo con esquinas redondas

Postby cuatecatl82 » Wed May 04, 2011 6: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
User avatar
cuatecatl82
 
Posts: 625
Joined: Wed Mar 14, 2007 6:49 pm
Location: San Cristobal de las Casas, Chiapas México

Re: Dialogo con esquinas redondas

Postby ronaldo » Sat May 07, 2011 6:15 pm

es pssivel, haga clic en la imagen y arrastre la pantalla
[b]Ronaldo Minacapelli[/b]
Sistemas, Hospedagem e Criação de WebSites
http://www.bazevani.com.br
User avatar
ronaldo
 
Posts: 139
Joined: Fri Nov 25, 2005 4:38 pm
Location: brasil

Re: Dialogo con esquinas redondas

Postby Baxajaun » 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
User avatar
Baxajaun
 
Posts: 964
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: Dialogo con esquinas redondas

Postby Daniel Garcia-Gil » Fri May 13, 2011 10:36 am

Hello

in your C code, do you have
#include <windows.h> ??
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Dialogo con esquinas redondas

Postby Baxajaun » Fri May 13, 2011 10:55 am

Daniel,

sólo he utilizado el ejemplo que está publicado en el post:

Code: Select all  Expand view

#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,
User avatar
Baxajaun
 
Posts: 964
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: Dialogo con esquinas redondas

Postby Carles » Fri May 13, 2011 11:15 am

B,

Añade los includes...

Code: Select all  Expand view
#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
Skype -> https://join.skype.com/cnzQg3Kr1dnk
User avatar
Carles
 
Posts: 1114
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona

Re: Dialogo con esquinas redondas

Postby Baxajaun » Fri May 13, 2011 11:21 am

Carles,

moltes gracies !!!

Code: Select all  Expand view

┌────────────────────────────────────────────────────────────────────────────┐
│ 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,
User avatar
Baxajaun
 
Posts: 964
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: Dialogo con esquinas redondas

Postby Baxajaun » Fri May 13, 2011 11:22 am

Carles,

el resultado anterior sin

Code: Select all  Expand view

#include <ClipApi.h>
 


Saludos,
User avatar
Baxajaun
 
Posts: 964
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests