FoxPro/Visual FoxPro - ventana moderna?

 
Vista:

ventana moderna?

Publicado por julio (52 intervenciones) el 09/11/2006 20:45:10
salu2
bueno tengo una pregunta sobre las ventanas de fox yo tengo la version 6.0 y me doy cuenta de que todas las ventanas son iguales claro le ´podemos cambiar el color de letra imagen de fondo como los botones, pero me preguntava ¿si es posible el poder cambiar el tipo de ventana? es decir si yo hago un diseño de alguna ventana que no sea un estandar rectangular si es to es posible como se hace?

espero sus respuestas
_______________________________________________________________________
Recuerda que el unico quien nos ayuda a aprender algo cada dia es jesús
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:ventana moderna?

Publicado por sergio (737 intervenciones) el 09/11/2006 21:52:05
La spodes hacer redondas
te paso el codigo:
Para probarlo ponelo tal cual te lo di en un prg y ejecutalo para ver el resultado

PUBLIC oForm

oForm = CreateObject("Tform")

oForm.Visible = .T.

DEFINE CLASS Tform As Form

#DEFINE badgeDiameter 528 &&264

#DEFINE topMargin 4

#DEFINE leftMargin 2

Width=550&&300
Height=550 &&350

AutoCenter=.T.

Picture="badge1.bmp"
backcolor=rgb(0,100,0)
hRgn=0

ADD OBJECT lbl As Label WITH Caption="Ingrese su Id:",;
FontName="Arial", FontSize=14, Bold=.T., BackStyle=0, Alignment=2,;
Forecolor=Rgb(255,255,225), Left=70, Top=80, Width=170, Height=25

ADD OBJECT txt1 As TextBox WITH Width=100, Height=24,;
Left=82, Top=105

ADD OBJECT txt2 As TextBox WITH Width=100, Height=24,;
Left=82, Top=140, PasswordChar="*"

ADD OBJECT cmd As CommandButton WITH Width=60, Height=25,;
Left=104, Top=180, Caption="Ok", Default=.T.

Procedure txt1.keypress
lparameters nKeyCode, nShiftAltCtrl
if nkeycode = 13

endif

PROCEDURE Init

DO decl
THISFORM.TXT1.VALUE = 'SERGIO'
THISFORM.TXT2.SETFOCUS()

PROCEDURE Activate

IF THIS.hRgn = 0
THIS.RegionOn
ENDIF

PROCEDURE RegionOn

#DEFINE SM_CYSIZE 31

#DEFINE SM_CXFRAME 32

#DEFINE SM_CYFRAME 33

LOCAL hwnd, x0, y0, x1, y1

* calculating position of the region

x0 = GetSystemMetrics(SM_CXFRAME) + leftMargin

y0 = GetSystemMetrics(SM_CYSIZE) + GetSystemMetrics(SM_CYFRAME) + topMargin

x1 = x0 + badgeDiameter

y1 = y0 + badgeDiameter

* creating an elliptical region

THIS.hRgn = CreateEllipticRgn (x0, y0, x1, y1)

hwnd = GetFocus()

* applying the region to the form

IF SetWindowRgn(hwnd, THIS.hRgn, 1) = 0

* if failed then release the handle

= DeleteObject (THIS.hRgn)

THIS.hRgn = 0

ENDIF

ENDPROC

PROCEDURE MouseDown

LPARAMETERS nButton, nShift, nXCoord, nYCoord

#DEFINE WM_SYSCOMMAND 0x112

#DEFINE WM_LBUTTONUP 0x202

#DEFINE MOUSE_MOVE 0xf012

IF nButton = 1

LOCAL hWindow

hWindow = GetFocus()

= ReleaseCapture()

= SendMessage(hWindow, WM_SYSCOMMAND, MOUSE_MOVE, 0)

= SendMessage(hWindow, WM_LBUTTONUP, 0, 0)

ENDIF



PROCEDURE cmd.Click

ThisForm.Release

ENDDEFINE

PROCEDURE decl

DECLARE INTEGER GetFocus IN user32

DECLARE INTEGER DeleteObject IN gdi32 INTEGER hObject

DECLARE INTEGER GetSystemMetrics IN user32 INTEGER nIndex

DECLARE INTEGER ReleaseCapture IN user32

DECLARE INTEGER SendMessage IN user32 INTEGER hWnd, INTEGER Msg,;
INTEGER wParam, INTEGER lParam

DECLARE INTEGER CreateEllipticRgn IN gdi32 INTEGER nLeftRect, INTEGER;
nTopRect,INTEGER nRightRect, INTEGER nBottomRect

DECLARE INTEGER SetWindowRgn IN user32;
INTEGER hWnd, INTEGER hRgn, INTEGER bRedraw
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:ventana moderna?

Publicado por Ernesto Hernandez (4623 intervenciones) el 10/11/2006 01:06:34
Interesante copia de este no ?

PUBLIC frm
FOR i =1 TO 10 STEP 1
frm = CreateObject ("Tform")
frm.Visible = .T.
ENDFOR
DEFINE CLASS Tform As Form
#DEFINE badgeDiameter 264
#DEFINE topMargin 4
#DEFINE leftMargin 2

Width = 300
Height = 350
AutoCenter = .T.
Picture="badge1.bmp"
BackColor=RGB(0,0,255)
hRgn=0

ADD OBJECT lbl As Label WITH;
Caption="Your ID:", FontName="Arial", FontSize=14,;
Bold=.T., Forecolor=Rgb(255,255,225), BackStyle=0,;
Alignment=2, Left=82, Width=100, Top=105, Height=25

ADD OBJECT txt As TextBox WITH;
Width=100, Height=24, Left=82, Top=130,;
PasswordChar="*"

ADD OBJECT cmd As CommandButton WITH;
Width=60, Height=25, Left=104, Top=165,;
Caption="Ok", Default=.T.

PROCEDURE Load
DO decl
ENDPROC

PROCEDURE Activate
THIS.RegionOn
ENDPROC

PROCEDURE RegionOn
#DEFINE SM_CYSIZE 31
#DEFINE SM_CXFRAME 32
#DEFINE SM_CYFRAME 33

IF THIS.hRgn <> 0
RETURN && the region is already set
ENDIF

LOCAL hwnd, x0, y0, x1, y1

* calculating the position of the region while considering
* dimensions of standard frames and title bars,
* which depends on current Windows settings

x0 = GetSystemMetrics (SM_CXFRAME) + leftMargin

y0 = GetSystemMetrics (SM_CYSIZE) +;
GetSystemMetrics (SM_CYFRAME) + topMargin

x1 = x0 + badgeDiameter
y1 = y0 + badgeDiameter

* creating an elliptical region to be applied to the form
* sizing and placing it exactly to display the badge
THIS.hRgn = CreateEllipticRgn (x0, y0, x1, y1)
hwnd = GetFocus()

*** the next line makes a difference
*** test this example with and without this IF-ENDIF fragment

IF SetWindowRgn (hwnd, THIS.hRgn, 1) = 0
* applying the region fails -- the handle to be released
= DeleteObject (THIS.hRgn)
THIS.hRgn = 0
ENDIF

*** ----------------------------
ENDPROC

PROCEDURE MouseDown( nButton, nShift, nXCoord, nYCoord )
#DEFINE WM_NULL 0
#DEFINE WM_SYSCOMMAND 274 && 0x112
#DEFINE MOUSE_MOVE 61458 && 0xF012

IF nButton = 1
= ReleaseCapture()
= SendMessage (GetFocus(), WM_SYSCOMMAND, MOUSE_MOVE, WM_NULL)
ENDIF
ENDPROC

PROCEDURE cmd.Click
ThisForm.Release
ENDPROC
ENDDEFINE

PROCEDURE decl
DECLARE INTEGER GetFocus IN user32
DECLARE INTEGER DeleteObject IN gdi32 INTEGER hObject
DECLARE INTEGER GetSystemMetrics IN user32 INTEGER nIndex
DECLARE INTEGER ReleaseCapture IN user32

DECLARE INTEGER SendMessage IN user32;
INTEGER hWnd, INTEGER Msg,;
INTEGER wParam, INTEGER lParam

DECLARE INTEGER CreateEllipticRgn IN gdi32;
INTEGER nLeftRect, INTEGER nTopRect,;
INTEGER nRightRect, INTEGER nBottomRect

DECLARE INTEGER SetWindowRgn IN user32;
INTEGER hWnd, INTEGER hRgn, INTEGER bRedraw
ENDPROC


Creo que es del portalfox si mal no recuerdo

Suerte

;-)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ventana moderna?

Publicado por Plinio (7841 intervenciones) el 10/11/2006 00:15:42
1- Si tienes VFP8 o superior puedes adaptar los formularios al tema que tengas en WIndows XP.
2- Puedes usar la claser VFPSKIN, existe una version 2 que es gratis
www.vfpskin.com.ar
3- http://www.sweetpotatosoftware.com/SPSBlog/PermaLink,guid,9a91dea3-6413-42e9-aeff-f0097937474d.aspx
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ventana moderna?

Publicado por Hector De los Santos (10 intervenciones) el 10/11/2006 16:00:37
Que tal...
Tambien puedes hacelo tu mismo, usando algun gestor de imagenes y hacer tus propios diseños y luego insertalos a tu formulario o botones...
Mira algunos ejemplos..las imagenes las hice en Macromedia Fireworks y las inserte a mis forms..mira como quedo.

http://jburgos.net/hector/lwp_cVfp_vPreview/cargando.JPG
http://jburgos.net/hector/lwp_cVfp_vPreview/entrada.JPG

Aunque se tome un poco mas de tiempo, pero queda como tu quieres y es bien original

Suerte!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar