Page 1 of 1
assign cursor object to btns
Posted: Sun Oct 14, 2012 3:52 pm
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 ?
Re: assign cursor object to btns
Posted: Sun Oct 14, 2012 4:50 pm
by kok joek hoa
Dear Eoeo,
try
AEval( oBar:aControls, { | o | o:oCursor := oHand } )
regards,
kok
Re: assign cursor object to btns
Posted: Sun Oct 14, 2012 10:22 pm
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
Re: assign cursor object to btns
Posted: Sun Oct 14, 2012 11:05 pm
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
Re: assign cursor object to btns
Posted: Sun Oct 14, 2012 11:20 pm
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, ) })
Re: assign cursor object to btns
Posted: Sun Oct 14, 2012 11:34 pm
by Eoeo
you're right
I forgot to fill an array ( I wrote two obtn[2] )
sorry now it is ok