Small buttonbar at x,y

Small buttonbar at x,y

Postby Silvio.Falconi » Wed Dec 06, 2023 8:40 pm

How is it possible that I can't view the buttons in a ButtonBar?

I wish Use the sample samples\barchange.prg, developed by Cristobal Navarro
but the buttonbar must be insert down a xbrowse
so I use Newat() method


barchange.prg with Newat() Method of oBar

Code: Select all  Expand view  RUN


// developed by Cristobal Navarro

#include 'fivewin.ch'
#include 'xbrowse.ch'
#include "constant.ch"

Function test()

   local oDlg,oDbf,oFont
   local oBar

   local  nBottom   := 27.2
   local  nRight    := 89
   local  nWd       := Max( nRight * DLG_CHARPIX_W, 180 )
   local  nHt       := nBottom * DLG_CHARPIX_H

   aData    := {}
   for n := 1 to 10
      AAdd( aData, { n, "Item-" + StrZero( n, 2 ), ;
         HB_RandomInt( 1, 999 ), HB_RandomInt( 1, 9999 ), ;
         Space( 5 ), ;
         HB_RandomInt( 1, 9999 ) } )
   next


   DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
         TiTle "test"
      oDlg:lHelpIcon := .F.


   @ 30,10 XBROWSE oBrw SIZE -10,-220 PIXEL OF oDlg ;
      DATASOURCE aData ;
      AUTOCOLS HEADERS { "SlNo", "Item" } ;
      COLSIZES 40 ;
      CELL LINES FOOTERS NOBORDER FASTEDIT

       oBrw:CreateFromCode()



   @ 250,  10 Button "Second bar" size 100,18 PIXEL OF oDlg action Btnbar(2,oDlg:oBar,oDlg,oBrw)
   @ 250, 200 Button "First bar"  size 100,18 PIXEL OF oDlg action Btnbar(1,oDlg:oBar,oDlg,oBrw)

   ACTIVATE DIALOG oDlg  CENTER  ;
          ON INIT ( Btnbar(0,oBar,oDlg,oBrw), Btnbar(1,oDlg:oBar,oDlg,oBrw) )
RETURN NIL

//----------------------------------------------------------------------------//

Function Btnbar(nBar,oBar,oDlg,oBrw)  // ,aBtnBar

   local aBtnBar
   local x

   if Valtype( oBar ) = "O"
      For x := Len( oBar:aControls ) to 1 step - 1
         oBar:Del( x )
      Next x
   endif

  Do case
  case nbar = 0
   *  DEFINE BUTTONBAR oBar OF oDlg  SIZE 80,70  TOP NOBORDER  2015

    oBar:= TBar():NewAt(  oBrw:nbottom+1, oBrw:nLeft, oBrw:nWidth-120, 25, 80, 25, oDlg, .f.,;
              , , .t., .f., .f., .t., .f., ;
              , , , , , .t. )
     oBar:bClrGrad := { | lPressed | If( ! lPressed,;
                 { { 1, RGB( 250,250,245), RGB( 250,250,245)} },;
                 { { 1, RGB( 245,245,235), RGB( 245,245,235)} } ) }



  case nbar = 1
   aBtnBar := array(6)
   DEFINE BUTTON aBtnBar[1] OF oBar PROMPT "New"       action msginfo()
   DEFINE BUTTON aBtnBar[2] OF oBar PROMPT "Modify"    action msginfo()
   DEFINE BUTTON aBtnBar[3] OF oBar PROMPT "Duplicate" action msginfo()
   DEFINE BUTTON aBtnBar[4] OF oBar PROMPT "Del"       action msginfo()
   DEFINE BUTTON aBtnBar[5] OF oBar PROMPT "Print"     action msginfo()
   DEFINE BUTTON aBtnBar[6] OF oBar PROMPT "Help"      action msginfo("Help")

  case nbar = 2
   aBtnBar := array(2)
   DEFINE BUTTON aBtnBar[1] OF oBar PROMPT "Del"       action msginfo("Del")
   DEFINE BUTTON aBtnBar[2] OF oBar PROMPT "Print"     action msginfo("Print")
 
  endcase

return oBar

//----------------------------------------------------------------------------/



 


Error
Code: Select all  Expand view  RUN

   Time from start: 0 hours 0 mins 0 secs
   Error occurred at: 12/06/23, 21:48:52
   Error description: Error BASE/1004  No exported method: ISKINDOF
   Args:
     [   1] = U  
     [   2] = C   TBAR

Stack Calls
===========
   Called from:  => ISKINDOF( 0 )
   Called from: C:\Work\fwh\source\classes\btnbmp.prg => TBTNBMP:NEWBAR( 491 )
   Called from: barchange.prg => BTNBAR( 76 )
   Called from: barchange.prg => (b)TEST( 45 )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Small buttonbar at x,y

Postby Silvio.Falconi » Wed Dec 06, 2023 9:08 pm

Perhaps I resolve with

oBar:Move( oBrw:nbottom+1, oBrw:nLeft )

when I change from one menu to another there is a flashing throughout the dialog and the xbrowse watch this video

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Small buttonbar at x,y

Postby cnavarro » Thu Dec 07, 2023 4:48 am

Silvio, OK, it's one possible solution, but in this case, please add
Code: Select all  Expand view  RUN

   oBar:oWnd:oTop := nil
 

and try
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Small buttonbar at x,y

Postby Silvio.Falconi » Thu Dec 07, 2023 8:31 am

cnavarro wrote:Silvio, OK, it's one possible solution, but in this case, please add
Code: Select all  Expand view  RUN

   oBar:oWnd:oTop := nil
 

and try


Make the same flash all
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Small buttonbar at x,y

Postby Otto » Thu Dec 07, 2023 10:10 am

Silvio,
Maybe this will help
topic:
viewtopic.php?f=3&t=17885&p=207288&hilit=flicker&sid=b97da231a3f07dfa7b59bf1f92c0e7b6#p207288

I will post the entire source again.

Regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: Small buttonbar at x,y

Postby Silvio.Falconi » Thu Dec 07, 2023 11:42 am

Otto wrote:Silvio,
Maybe this will help
topic:
viewtopic.php?f=3&t=17885&p=207288&hilit=flicker&sid=b97da231a3f07dfa7b59bf1f92c0e7b6#p207288

I will post the entire source again.

Regards,
Otto

do U have try the test ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Small buttonbar at x,y

Postby Otto » Thu Dec 07, 2023 3:11 pm

Silvio, which test?
Regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: Small buttonbar at x,y

Postby nageswaragunupudi » Thu Dec 07, 2023 6:29 pm

This sample is not flickering for me
Code: Select all  Expand view  RUN
#include "fivewin.ch"

function Main()

   local oDlg, oBrw, oBar1, oBar2, aRow, aData := Array( 8, 6 )

   for each aRow in aData
      AEval( aRow, { |u,i| aRow[ i ] := HB_RandomInt( 100,500 ) } )
   next

   DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL

   @  20, 20 XBROWSE oBrw SIZE 480,200 PIXEL OF oDlg ;
      DATASOURCE aData AUTOCOLS CELL LINES NOBORDER
   oBrw:CreateFromCode()

   oDlg:bInit := <||

      @ 220,20 BUTTONBAR oBar1 OF oDlg SIZE 480,32 BUTTONSIZE 100,32
      oBar1:l2007 := .t.
      DEFINE BUTTON OF oBar1 PROMPT "ONE" CENTER
      DEFINE BUTTON OF oBar1 PROMPT "TWO" CENTER
      DEFINE BUTTON OF oBar1 PROMPT "THREE" CENTER
      oBar1:Hide()

      @ 220,20 BUTTONBAR oBar2 OF oDlg SIZE 480,32 BUTTONSIZE 100,32
      oBar2:l2007 := .t.
      DEFINE BUTTON OF oBar2 PROMPT "JAN" CENTER
      DEFINE BUTTON OF oBar2 PROMPT "FEB" CENTER
      DEFINE BUTTON OF oBar2 PROMPT "MARCH" CENTER

      return nil
      >

   @ 280, 20 BUTTON "FIRST BAR" SIZE 150,40 PIXEL OF oDlg ;
      WHEN oBar2:lVisible ACTION ( oBar2:Hide(), oBar1:Show() )
   @ 280,200 BUTTON "SECOND BAR" SIZE 150,40 PIXEL OF oDlg ;
      WHEN oBar1:lVisible ACTION ( oBar1:Hide(), oBar2:Show() )

   ACTIVATE DIALOG oDlg CENTERED

return nil
 
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

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