Dialogo con esquinas redondas

Re: Dialogo con esquinas redondas

Postby Baxajaun » Sun May 15, 2011 6:41 am

Buenas,

como dice Ronaldo se podría pulsar en la imagen y mover el diálogo ? Y que los bontones tuviesen los bordes redondeados ?

Muchas gracias.

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

Re: Dialogo con esquinas redondas

Postby Rochinha » Sat Apr 21, 2012 4:09 am

Friends,

With this change will move the window by clicking on the top corners.

Code: Select all  Expand view

#include "FiveWin.ch"

function Main()

   local oDlg, oBrush, oFont
   local nVar  := 100
   
   public mover := .t.
   public nRounder := 20 // Change this value betwen 0 and 250 to see a results
   
   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
         
          @ 000,000 BITMAP resource "" NOBORDER OF oDlg PIXEL SIZE 80,21 ON LEFT CLICK Click(oDlg)
         
          @ 010,010 SAY "This is some Text" SIZE 80,12 PIXEL OF oDlg COLOR CLR_WHITE,CLR_BLACK TRANSPARENT
          @ 030,010 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 Click(yvent)

   If !mover
      return nil
   Endif
   
   Do while GetKeyState(VK_LBUTTON)
      nGCPos := GetCursorpos()
      MoveWindow( yvent:hWnd, nGCPos[1],nGCPos[2], yvent:nWidth,yvent:nHeight,.t. )
      Sysrefresh()
      If !GetKeyState(VK_LBUTTON)
         Exit
      Endif
   Enddo
   nGCPos := GetCursorpos()

return nil

static function RoundCorners( oDlg )

   local aRect, hRgn

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

return nil

#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
 
Rochinha
 
Posts: 310
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo

Re: Dialogo con esquinas redondas

Postby karinha » Fri Oct 02, 2020 3:21 am

Muy bueno, very good!
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 46 guests