tbmenu

tbmenu

Postby Silvio » Fri Sep 19, 2008 9:03 am

why I cannot insert a variable oItem on this command ?

DEFINE TBMENU ::oItem OF oBar ;
MENU ::Multi()

give this error
[1]:Harbour.Exe rpreview.prg /m /n /es2 /iC:\work\FWH\include /ic:\work\xHarbour\Include /iinclude;c:\work\fwh\include;c:\work\xHarbour\include /oObj\rpreview.c
xHarbour Compiler build 0.99.71 (SimpLex)
Copyright 1999-2007, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'test.prg'...
rpreview.prg(376) Error E0030 Syntax error: "parse error at 'TBMENU'"
rpreview.prg(383) Error E0030 Syntax error: "parse error at 'TBBUTTON'"



I need to inizialize the ::oItem

thanks

thanks
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Fri Sep 19, 2008 9:16 am

Silvio,

You can't because the ToolBar object does not manage buttons as objects.

You can access its properties from its index into oToolBar:aButtons
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Fri Sep 19, 2008 9:22 am

Sorry Antonio
I stay to modify my preview there is some error
Look it please
Code: Select all  Expand view  RUN

if IsAppThemed() .and. ! l2007
      DEFINE IMAGELIST oImageList SIZE 16, 16

      oImageList:AddMasked( TBitmap():Define( "top2",, ::oWnd ), nRGB( 192, 192, 192 ) )
      oImageList:AddMasked( TBitmap():Define( "previous2",, ::oWnd ), nRGB( 192, 192, 192 ) )
      oImageList:AddMasked( TBitmap():Define( "next2",, ::oWnd ), nRGB( 192, 192, 192 ) )
      oImageList:AddMasked( TBitmap():Define( "bottom2",, ::oWnd ), nRGB( 192, 192, 192 ) )
      oImageList:AddMasked( TBitmap():Define( "zoom2",, ::oWnd ), nRGB( 192, 192, 192 ) )
      oImageList:AddMasked( TBitmap():Define( "Two_pages2",, ::oWnd ), nRGB( 192, 192, 192 ) )
      oImageList:AddMasked( TBitmap():Define( "printer2",, ::oWnd ), nRGB( 255, 0, 255 ) )
      oImageList:AddMasked( TBitmap():Define( "exit2",, ::oWnd ), nRGB( 192, 192, 192 ) )




      oImageList:AddMasked( TBitmap():Define( "unzoom2",, ::oWnd ), nRGB( 192, 192, 192 ) )
      oImageList:AddMasked( TBitmap():Define( "one_page2",, ::oWnd ), nRGB( 192, 192, 192 ) )
      ::oImageList = oImageList

      oReBar = TReBar():New( ::oWnd )

      DEFINE TOOLBAR oBar OF oReBar SIZE 25, 25 IMAGELIST oImageList

      ::oBar = oBar
      oReBar:InsertBand( oBar )

      oBar:nHeight -= 2

      DEFINE TBBUTTON OF oBar ;
         ACTION  ::TopPage() ;
         TOOLTIP Strtran( TXT_FIRST, "&", "" ) ;
         MESSAGE TXT_GOTO_FIRST_PAGE

      DEFINE TBBUTTON OF oBar ;
         ACTION  ::PrevPage() ;
         TOOLTIP Strtran( TXT_PREVIOUS, "&", "" ) ;
         MESSAGE TXT_GOTO_PREVIOUS_PAGE

      DEFINE TBBUTTON OF oBar ;
         ACTION  ::NextPage() ;
         TOOLTIP Strtran( TXT_NEXT, "&", "" ) ;
         MESSAGE TXT_GOTO_NEXT_PAGE

      DEFINE TBBUTTON OF oBar ;
         ACTION  ::BottomPage() ;
         TOOLTIP Strtran( TXT_LAST, "&", "" ) ;
         MESSAGE TXT_GOTO_LAST_PAGE

      DEFINE TBSEPARATOR OF oBar

      DEFINE TBBUTTON OF oBar ;
         ACTION  ::Zoom() ;
         TOOLTIP Strtran( TXT_ZOOM, "&", "" ) ;
         MESSAGE TXT_ZOOM_THE_PREVIEW




IF ::lMulti

DEFINE TBMENU ::oMultipages OF oBar ;
MENU ::MultiPopup() ;
TOOLTIP StrTran( Strtran( TXT_TWOPAGES, "&", "" ), "á", "a" ) ;
MESSAGE TXT_PREVIEW_ON_TWO_PAGES


ELSE
DEFINE TBBUTTON ::oTwoPages OF oBar ;
ACTION ::TwoPages() ;
TOOLTIP StrTran( Strtran( TXT_TWOPAGES, "&", "" ), "á", "a" ) ;
MESSAGE TXT_PREVIEW_ON_TWO_PAGES
ENDIF
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Fri Sep 19, 2008 9:25 am

How I must make ?

DEFINE TBMENU oBar:oMultipages OF oBar ????
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Fri Sep 19, 2008 9:44 am

Silvio,

Please review fwh\samples\ToolBar1.prg

Look for TBMENU use in it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Silvio » Fri Sep 19, 2008 9:51 am

yes I found it the test but I must inizialize the oMultipages variable

If lmulti

Tbbmenu ::omultipage
ELSE
tbutton ::twopages

endif

because
My modifies run error when I write

if ! IsAppThemed()
::oMultiPages:FreeBitmaps() ::oMultiPages:LoadBitmaps("One_Page")
::oMultiPages:cMsg := TXT_PREVIEW_ON_ONE_PAGE
::oMultiPages:cTooltip := StrTran(TXT_ONEPAGE,"&","")
else
::oBar:ChangeBitmap( 6, 14 )
::oBar:SetTooltip( 6, StrTran(TXT_ONEPAGE,"&","") )
::oBar:SetMessage( 6, TXT_PREVIEW_ON_ONE_PAGE )
endif



on this line there is an error
Time from start: 0 hours 1 mins 32 secs
Error occurred at: 09/19/08, 09:01:26
Error description: Error BASE/1004 Class: 'NIL' has no exported method: FREEBITMAPS
Args:
[ 1] = U

Stack Calls
===========
Called from: => FREEBITMAPS(0)
Called from: rpreview.prg => TPREVIEW:MULTIPAGES(2145)
Called from: rpreview.prg => (b)TPREVIEW:BUILDMENU(812)
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Fri Sep 19, 2008 10:03 am

if I make


Code: Select all  Expand view  RUN
  IF ::lMulti

      DEFINE TBMENU  OF oBar ;
      MENU   ::MultiPopup() ;
      TOOLTIP StrTran( Strtran( TXT_TWOPAGES, "&", "" ), "á", "a" ) ;
      MESSAGE TXT_PREVIEW_ON_TWO_PAGES


   ELSE
         DEFINE TBBUTTON  OF oBar ;
         ACTION  ::TwoPages() ;
         TOOLTIP StrTran( Strtran( TXT_TWOPAGES, "&", "" ), "á", "a" ) ;
         MESSAGE TXT_PREVIEW_ON_TWO_PAGES
      ENDIF



run ok
but when I must chanche the bitmaps run error



Code: Select all  Expand view  RUN

if ! IsAppThemed()
              ::oMultiPages:FreeBitmaps()
              ::oMultiPages:LoadBitmaps("One_Page")
              ::oMultiPages:cMsg := TXT_PREVIEW_ON_ONE_PAGE
              ::oMultiPages:cTooltip := StrTran(TXT_ONEPAGE,"&","")
          else
             ::oBar:ChangeBitmap( 6, 14 )
             ::oBar:SetTooltip( 6, StrTran(TXT_ONEPAGE,"&","") )
             ::oBar:SetMessage( 6, TXT_PREVIEW_ON_ONE_PAGE )
          endif


because it not found ::oMultiPages


But Now perhaps I resolve it now
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 75 guests