assign cursor object to btns

Post Reply
User avatar
Eoeo
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

assign cursor object to btns

Post by Eoeo »

I have many rbbtn into a ribbon and I wish use the cursor hand

Local oBtn[40]

DEFINE CURSOR oHand HAND

@ 5,5 ADD BUTTON oBtn[1] PROMPT "Imprimir" ;
BITMAP "RIBBON_IMPRIMIR" ;
GROUP oGr1 ROUND SIZE 83,75 ACTION PrinterSetup()

...
AEval(oBtn,{|n| oBtn[n]:oCursor:= oHand })

why it make error ?
kok joek hoa
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: assign cursor object to btns

Post by kok joek hoa »

Dear Eoeo,

try

AEval( oBar:aControls, { | o | o:oCursor := oHand } )

regards,

kok
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: assign cursor object to btns

Post by Daniel Garcia-Gil »

Hello

the correct code is

AEval(oBtn,{|n| n:oCursor:= oHand })

"n" is the each element in array isn't a index

remember:
when report a error please post the error.log, this way we can do a better support, thanks
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Eoeo
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: assign cursor object to btns

Post by Eoeo »

thanks but not run ok

Code: Select all

Application
===========
   Path and name: C:\work\Prg\Ste\StePyme.Exe (32 bits)
   Size: 3,453,440 bytes
   Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6715)
   FiveWin  Version: FWHX 12.03
   Windows version: 5.1, Build 2600 Service Pack 3

   Time from start: 0 hours 0 mins 3 secs 
   Error occurred at: 15-10-2012, 01:06:37
   Error description: Error BASE/1005  Class: 'NIL' has no property: OCURSOR
   Args:
     [   1] = U   
     [   2] = O   TCURSOR

Stack Calls
===========
   Called from:  => _OCURSOR( 0 )
   Called from: source\main.prg => (b)TAPPLICATION:BUILDBTNBAR( 624 )
   Called from:  => AEVAL( 0 )
   Called from: source\main.prg => TAPPLICATION:BUILDBTNBAR( 624 )
   Called from: source\main.prg => TAPPLICATION:NEW( 397 )
   Called from: source\main.prg => MAIN( 47 )

System
======
   CPU type: Mobile AMD Sempron(tm) Processor 3000+ 1783 Mhz
   Hardware memory: 895 megs

   Free System resources: 0 %
        GDI    resources: 0 %
        User   resources: 0 %

   Windows total applications running: 14
      1 , C:\Documents and Settings\Intro\Impostazioni locali\Dati applicazioni\Google\Chrome\Application\chrome.exe
      2 , C:\Programmi\3 Internet\3 Internet.exe
      3 , C:\Programmi\OpenOffice.org 3\program\soffice.bin
      4 , C:\Programmi\REALTEK\RTL8187 Wireless LAN Utility\RtWLan.exe
      5 , C:\WINDOWS\Explorer.EXE
      6 , C:\WINDOWS\system32\wscntfy.exe
      7 , C:\work\xMate\xMate.exe
      8 ATI video bios poller client, C:\WINDOWS\system32\Ati2evxx.exe
      9 Aggiornamenti automatici, C:\WINDOWS\system32\wuauclt.exe
     10 Beyond Quick Launch Buttons Message Window, C:\Programmi\Hewlett-Packard\HP Quick Launch Buttons\QlbCtrl.exe
     11 CiceroUIWndFrame, C:\WINDOWS\system32\ctfmon.exe
     12 DIEmWin, C:\Programmi\ATI Technologies\Pannello di controllo ATI\atiptaxx.exe
     13 Extracting Files, C:\WINDOWS\SoftwareDistribution\Download\Install\Windows-KB890830-V4.13.exe
     14 StePyme, C:\work\Prg\Ste\StePyme.Exe

Variables in use
================
   Procedure     Type   Value
   ==========================
   _OCURSOR
     Param   1:    O    Class: TCURSOR
     Local   1:    A    Len:    1
     Local   2:    U    
     Local   3:    U    
   (b)TAPPLICATION:BUILDBTNBAR
     Param   1:    U    
     Param   2:    N    3
   AEVAL
     Param   1:    A    Len:   40
     Param   2:    B    {|| ... }
   TAPPLICATION:BUILDBTNBAR
     Local   1:    O    Class: TAPPLICATION
     Local   2:    A    Len:    3
     Local   3:    N    115
     Local   4:    N    0
     Local   5:    O    Class: TRBGROUP
     Local   6:    O    Class: TRBGROUP
     Local   7:    O    Class: TRBGROUP
     Local   8:    U    
     Local   9:    U    
     Local  10:    A    Len:   40
   TAPPLICATION:NEW
     Local   1:    O    Class: TAPPLICATION
     Local   2:    L    .F.
   MAIN

Linked RDDs
===========
   DBF
   DBFFPT
   DBFNTX
   DBFBLOB
   DBFCDX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HASHENTRY
     3 HBCLASS
     4 HBOBJECT
     5 TAPPLICATION
     6 TFONT
     7 TWINDOW
     8 TCONTROL
     9 TBITMAP
    10 TIMAGE
    11 TINI
    12 TICON
    13 TBRUSH
    14 TMENU
    15 TMENUITEM
    16 TMSGBAR
    17 TRECT
    18 TMSGITEM
    19 TTIMER
    20 TCURSOR
    21 TRIBBONBAR
    22 TRPANEL
    23 TRBGROUP
    24 TRBTN
    25 TREG32

Memory Analysis
===============
      250 Static variables

   Dynamic memory consume:
      Actual  Value:          0 bytes
      Highest Value:          0 bytes
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: assign cursor object to btns

Post by Daniel Garcia-Gil »

oBtn[40]

are you filling all array?

the error is absolutely clear, one element in array is NIL

AEval(oBtn,{|n| If( n != NIL, n:oCursor:= oHand, ) })
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Eoeo
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: assign cursor object to btns

Post by Eoeo »

you're right
I forgot to fill an array ( I wrote two obtn[2] )

sorry now it is ok
Post Reply