Page 1 of 1

help for a background

Posted: Wed Jul 30, 2008 8:19 pm
by Silvio
I must insert a background into a window child but the image not is filled into this wchild .
this is my code test

Code: Select all

#define OSFONDO   "D48.JPG"


  static oWnd



function Main()

   local oBar

   DEFINE WINDOW oWnd TITLE "Test" MDI ;
      MENU BuildMenu()

 DEFINE BUTTONBAR oBar 3DLOOK BUTTONSIZE 39,39 OF oWnd 2007


SET MESSAGE OF oWnd TO "test image" NOINSET 2007

   ACTIVATE WINDOW oWnd

return nil

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "Test"
      MENU
         MENUITEM "Beach" ACTION Beach()
      ENDMENU
      oMenu:AddMdi()
   ENDMENU

return oMenu

function beach()
 LOCAL oWChld

DEFINE WINDOW oWChld OF oWnd MDICHILD  ;
TITLE 'Beach Plan'

@0,0 IMAGE oImg FILENAME OSFONDO OF oWChld SIZE oWChld:nWidth, oWChld:nHeight PIXEL ADJUST



          cRegistro := "OMBRELLONI : "
          cAutore   := "Liberi  : "
          cSyst     := "Occupati : "

 SET MESSAGE OF  oWChld TO "" NOINSET
 DEFINE MSGITEM OF  oWChld:oMSGBAR  prompt cregistro  size 150 ACTION    nil
 DEFINE MSGITEM OF  oWChld:oMSGBAR  prompt  cAutore  size 150 ACTION    nil
 DEFINE MSGITEM OF  oWChld:oMSGBAR  prompt cSyst  size 150 ACTION    nil

ACTIVATE WINDOW oWChld MAXIMIZED

 return nil

have you an idea ?

Wnd-Background

Posted: Thu Jul 31, 2008 9:03 am
by ukoenig
Hello Silvio,
just a sample ;

Code: Select all


DEFINE IMAGE oImage FILENAME SW_LOGO  TRANSPARENT
DEFINE WINDOW oWnd TITLE "Your Title"  MDI MENU TMenu():New() 

DEFINE BUTTONBAR oBar1 3DLOOK OF oWnd BUTTONSIZE 70,80 2007 RIGHT

// Button 1
DEFINE BUTTON oBtn1 OF oBar1 ACTION ( NIL ) ;
RESOURCE "null_5" 

// Button 2
DEFINE BUTTON oBtn2 OF oBar1 ACTION ( SYS_HELP() )  ;
RESOURCE "info_5" PROMPT "Help for" + CRLF + "Visual Tools"	

....
....
....

// Button 5
DEFINE BUTTON oBtn5 OF oBar1 ;
ACTION SHOW_FILE( SetOption(nOption) ) ;                 
RESOURCE "magic_5" PROMPT "Show " + CRLF + "Design"

// Button 6
DEFINE BUTTON oBtn9 OF oBar1 ACTION ( oWnd:End() ) ;
RESOURCE "ende_5" PROMPT "&Exit"	

// You can place a GIF somewhere
// use < ON PAINT > to show a background

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT ( PalBmpDraw( hDC, 0, 0, oImage:hBitmap, , oWnd:nWidth, oWnd:nHeight ) ) ;
ON INIT ( oBtn5:Disable(), PlaceGif1( oWnd, oBar1) )
oImage:End()   

Best Regards
Uwe :lol:

Posted: Thu Jul 31, 2008 9:07 am
by Antonio Linares
Silvio,

oWChld:oClient = oImg

Posted: Thu Jul 31, 2008 9:26 pm
by Silvio
Antonio
i must insert on wchild many buttons
Now the wchild paint the jpg but I cannot clik on buttons why ?

look this code



#INCLUDE"FIVEWIN.CH"


#define OSFONDO "D48.JPG"


static oWnd



function Main()

local oBar

DEFINE WINDOW oWnd TITLE "Test" MDI ;
MENU BuildMenu()

DEFINE BUTTONBAR oBar 3DLOOK BUTTONSIZE 39,39 OF oWnd 2007


SET MESSAGE OF oWnd TO "test image" NOINSET 2007

ACTIVATE WINDOW oWnd

return nil

function BuildMenu()

local oMenu

MENU oMenu
MENUITEM "Test"
MENU
MENUITEM "Beach" ACTION Beach()
ENDMENU
oMenu:AddMdi()
ENDMENU

return oMenu

function beach()
LOCAL oWChld

DEFINE WINDOW oWChld OF oWnd MDICHILD ;
TITLE 'Beach Plan'

@0,0 IMAGE oImg FILENAME OSFONDO OF oWChld SIZE oWChld:nWidth, oWChld:nHeight PIXEL ADJUST
oWChld:oClient = oImg



@ 70, 80 BTNBMP oBtn FILENAME "../bitmaps/yes.bmp" ;
SIZE 50, 30 OF oWChld NOBORDER ACTION MsgInfo( "click" )






cRegistro := "OMBRELLONI : "
cAutore := "Liberi : "
cSyst := "Occupati : "

SET MESSAGE OF oWChld TO "" NOINSET
DEFINE MSGITEM OF oWChld:oMSGBAR prompt cregistro size 150 ACTION nil
DEFINE MSGITEM OF oWChld:oMSGBAR prompt cAutore size 150 ACTION nil
DEFINE MSGITEM OF oWChld:oMSGBAR prompt cSyst size 150 ACTION nil

ACTIVATE WINDOW oWChld MAXIMIZED

return ni