context menu in the spread sheet OWC

C

cui

Hi,

I want to know how I can retrieve the context menu of the OWC spreadsheet
(version 10).

Thanks
 
A

Alvin Bruney [MVP]

you can get to the menu thru events in visual basic client side

spreadsheetname_contextmenu()
code goes here

You will need to redim an array to add values to the menu. The array will
hold the current items in the menu plus your own personal items. Wire your
menu item to code via the click event.
 
C

cui

I thank you.

But I don't understand something...

I work with javascript language...

I have a spreadsheet object. And I attach some events like this:
myspreadsheet.AttachEvent("BeforeContextMenu", fct_beforeContextMenu) ;
myspreadsheet.AttachEvent("DblClick", fct_DblClick) ;

and
function fct_DblClick() { alert("HELLO") ; }
function fct_beforeContextMenu(x,y, mnu, value) {alert("HELLO") ; }

When I dble click on a cell, I have correctly the hello message. But
impossible with the right click.... Then, I ask me if if don't use another
handler than beforeContextMenu, but which one?

Thanks.

Alvin Bruney said:
you can get to the menu thru events in visual basic client side

spreadsheetname_contextmenu()
code goes here

You will need to redim an array to add values to the menu. The array will
hold the current items in the menu plus your own personal items. Wire your
menu item to code via the click event.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
Hi,

I want to know how I can retrieve the context menu of the OWC spreadsheet
(version 10).

Thanks
 
C

cui

Alvin,

I follow an example found in OWCVBA10.Chm. here the code (the id spreadsheet
is 'ss':

sub ss_dblclick()
Dim cmContextMenu(4)
Dim cmClearSubMenu(2)
cmClearSubMenu(0) = Array("All", "ClearAll")
cmClearSubMenu(1) = Array("Formats", "ClearFormats")
cmClearSubMenu(2) = Array("Values", "ClearValues")
cmContextMenu(0) = Array("Cut", "owc2")
cmContextMenu(1) = Array("Copy", "owc3")
cmContextMenu(2) = Array("Paste", "owc4")
cmContextMenu(3) = Empty cm
ContextMenu(4) = Array("Clear", cmClearSubMenu)
ss.ShowContextMenu 10,40, cmContextMenu
end sub


This code is correct, with ss_dblclick or ss_click, but I tried as you said
with ss_contextmenu... but nothing done...
I don't understant. I tried also ss_oncontextmenu, and ss_beforecontextmenu,
but it doesn't resolve my probleme.

I didn't learn vb script, but perhaps, I can retrieve the right click. Don't
you? Thanks.

After, I prefer translate the code in javascript language in order to keep
the coherence between my different pages.

Thanks for your help.


cui said:
I thank you.

But I don't understand something...

I work with javascript language...

I have a spreadsheet object. And I attach some events like this:
myspreadsheet.AttachEvent("BeforeContextMenu", fct_beforeContextMenu) ;
myspreadsheet.AttachEvent("DblClick", fct_DblClick) ;

and
function fct_DblClick() { alert("HELLO") ; }
function fct_beforeContextMenu(x,y, mnu, value) {alert("HELLO") ; }

When I dble click on a cell, I have correctly the hello message. But
impossible with the right click.... Then, I ask me if if don't use another
handler than beforeContextMenu, but which one?

Thanks.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le message
de news:%[email protected]...
you can get to the menu thru events in visual basic client side

spreadsheetname_contextmenu()
code goes here

You will need to redim an array to add values to the menu. The array will
hold the current items in the menu plus your own personal items. Wire your
menu item to code via the click event.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
Hi,

I want to know how I can retrieve the context menu of the OWC spreadsheet
(version 10).

Thanks
 
A

Alvin Bruney [MVP]

the javascript way of trapping events is a bit involved. I don't have the
code with me as I am at home right now. I can look it up tomorrow. It's
easier done with vbscript which is why i recommended it in the first place.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
Alvin,

I follow an example found in OWCVBA10.Chm. here the code (the id
spreadsheet
is 'ss':

sub ss_dblclick()
Dim cmContextMenu(4)
Dim cmClearSubMenu(2)
cmClearSubMenu(0) = Array("All", "ClearAll")
cmClearSubMenu(1) = Array("Formats", "ClearFormats")
cmClearSubMenu(2) = Array("Values", "ClearValues")
cmContextMenu(0) = Array("Cut", "owc2")
cmContextMenu(1) = Array("Copy", "owc3")
cmContextMenu(2) = Array("Paste", "owc4")
cmContextMenu(3) = Empty cm
ContextMenu(4) = Array("Clear", cmClearSubMenu)
ss.ShowContextMenu 10,40, cmContextMenu
end sub


This code is correct, with ss_dblclick or ss_click, but I tried as you
said
with ss_contextmenu... but nothing done...
I don't understant. I tried also ss_oncontextmenu, and
ss_beforecontextmenu,
but it doesn't resolve my probleme.

I didn't learn vb script, but perhaps, I can retrieve the right click.
Don't
you? Thanks.

After, I prefer translate the code in javascript language in order to keep
the coherence between my different pages.

Thanks for your help.


cui said:
I thank you.

But I don't understand something...

I work with javascript language...

I have a spreadsheet object. And I attach some events like this:
myspreadsheet.AttachEvent("BeforeContextMenu", fct_beforeContextMenu) ;
myspreadsheet.AttachEvent("DblClick", fct_DblClick) ;

and
function fct_DblClick() { alert("HELLO") ; }
function fct_beforeContextMenu(x,y, mnu, value) {alert("HELLO") ; }

When I dble click on a cell, I have correctly the hello message. But
impossible with the right click.... Then, I ask me if if don't use
another
handler than beforeContextMenu, but which one?

Thanks.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le message
de news:%[email protected]...
you can get to the menu thru events in visual basic client side

spreadsheetname_contextmenu()
code goes here

You will need to redim an array to add values to the menu. The array will
hold the current items in the menu plus your own personal items. Wire your
menu item to code via the click event.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi,

I want to know how I can retrieve the context menu of the OWC spreadsheet
(version 10).

Thanks
 
C

cui

OK. I trust in you. And therefore I'll use the vb script.

But I can't display a context menu on the click event, but not in the
contextmenu or on the right-click. Thanks. For today, I will create a new
button above the spread sheet control.

Thanks for your help.

Alvin Bruney said:
the javascript way of trapping events is a bit involved. I don't have the
code with me as I am at home right now. I can look it up tomorrow. It's
easier done with vbscript which is why i recommended it in the first place.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
Alvin,

I follow an example found in OWCVBA10.Chm. here the code (the id
spreadsheet
is 'ss':

sub ss_dblclick()
Dim cmContextMenu(4)
Dim cmClearSubMenu(2)
cmClearSubMenu(0) = Array("All", "ClearAll")
cmClearSubMenu(1) = Array("Formats", "ClearFormats")
cmClearSubMenu(2) = Array("Values", "ClearValues")
cmContextMenu(0) = Array("Cut", "owc2")
cmContextMenu(1) = Array("Copy", "owc3")
cmContextMenu(2) = Array("Paste", "owc4")
cmContextMenu(3) = Empty cm
ContextMenu(4) = Array("Clear", cmClearSubMenu)
ss.ShowContextMenu 10,40, cmContextMenu
end sub


This code is correct, with ss_dblclick or ss_click, but I tried as you
said
with ss_contextmenu... but nothing done...
I don't understant. I tried also ss_oncontextmenu, and
ss_beforecontextmenu,
but it doesn't resolve my probleme.

I didn't learn vb script, but perhaps, I can retrieve the right click.
Don't
you? Thanks.

After, I prefer translate the code in javascript language in order to keep
the coherence between my different pages.

Thanks for your help.


cui said:
I thank you.

But I don't understand something...

I work with javascript language...

I have a spreadsheet object. And I attach some events like this:
myspreadsheet.AttachEvent("BeforeContextMenu", fct_beforeContextMenu) ;
myspreadsheet.AttachEvent("DblClick", fct_DblClick) ;

and
function fct_DblClick() { alert("HELLO") ; }
function fct_beforeContextMenu(x,y, mnu, value) {alert("HELLO") ; }

When I dble click on a cell, I have correctly the hello message. But
impossible with the right click.... Then, I ask me if if don't use
another
handler than beforeContextMenu, but which one?

Thanks.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le message
de you can get to the menu thru events in visual basic client side

spreadsheetname_contextmenu()
code goes here

You will need to redim an array to add values to the menu. The array will
hold the current items in the menu plus your own personal items. Wire your
menu item to code via the click event.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi,

I want to know how I can retrieve the context menu of the OWC
spreadsheet
(version 10).

Thanks
 
A

Alvin Bruney [MVP]

sp_BeforeContextMenu(x, y, Menu, Cancel)
is what you are after. this fires before the menu appears. you can put your
code in there to customize the menu when the user clicks the right mouse
button

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
OK. I trust in you. And therefore I'll use the vb script.

But I can't display a context menu on the click event, but not in the
contextmenu or on the right-click. Thanks. For today, I will create a new
button above the spread sheet control.

Thanks for your help.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le
message
de news:[email protected]...
the javascript way of trapping events is a bit involved. I don't have the
code with me as I am at home right now. I can look it up tomorrow. It's
easier done with vbscript which is why i recommended it in the first place.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
Alvin,

I follow an example found in OWCVBA10.Chm. here the code (the id
spreadsheet
is 'ss':

sub ss_dblclick()
Dim cmContextMenu(4)
Dim cmClearSubMenu(2)
cmClearSubMenu(0) = Array("All", "ClearAll")
cmClearSubMenu(1) = Array("Formats", "ClearFormats")
cmClearSubMenu(2) = Array("Values", "ClearValues")
cmContextMenu(0) = Array("Cut", "owc2")
cmContextMenu(1) = Array("Copy", "owc3")
cmContextMenu(2) = Array("Paste", "owc4")
cmContextMenu(3) = Empty cm
ContextMenu(4) = Array("Clear", cmClearSubMenu)
ss.ShowContextMenu 10,40, cmContextMenu
end sub


This code is correct, with ss_dblclick or ss_click, but I tried as you
said
with ss_contextmenu... but nothing done...
I don't understant. I tried also ss_oncontextmenu, and
ss_beforecontextmenu,
but it doesn't resolve my probleme.

I didn't learn vb script, but perhaps, I can retrieve the right click.
Don't
you? Thanks.

After, I prefer translate the code in javascript language in order to keep
the coherence between my different pages.

Thanks for your help.


"cui" <cuisystem@_with-provider----free.fr> a écrit dans le message de
I thank you.

But I don't understand something...

I work with javascript language...

I have a spreadsheet object. And I attach some events like this:
myspreadsheet.AttachEvent("BeforeContextMenu", fct_beforeContextMenu)
;
myspreadsheet.AttachEvent("DblClick", fct_DblClick) ;

and
function fct_DblClick() { alert("HELLO") ; }
function fct_beforeContextMenu(x,y, mnu, value) {alert("HELLO") ; }

When I dble click on a cell, I have correctly the hello message. But
impossible with the right click.... Then, I ask me if if don't use
another
handler than beforeContextMenu, but which one?

Thanks.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le
message
de you can get to the menu thru events in visual basic client side

spreadsheetname_contextmenu()
code goes here

You will need to redim an array to add values to the menu. The array
will
hold the current items in the menu plus your own personal items.
Wire
your
menu item to code via the click event.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi,

I want to know how I can retrieve the context menu of the OWC
spreadsheet
(version 10).

Thanks
 
C

cui

OK. You're right. Thank you very much.

cui.


Alvin Bruney said:
sp_BeforeContextMenu(x, y, Menu, Cancel)
is what you are after. this fires before the menu appears. you can put your
code in there to customize the menu when the user clicks the right mouse
button

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
OK. I trust in you. And therefore I'll use the vb script.

But I can't display a context menu on the click event, but not in the
contextmenu or on the right-click. Thanks. For today, I will create a new
button above the spread sheet control.

Thanks for your help.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le
message
de news:[email protected]...
the javascript way of trapping events is a bit involved. I don't have the
code with me as I am at home right now. I can look it up tomorrow. It's
easier done with vbscript which is why i recommended it in the first place.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

I follow an example found in OWCVBA10.Chm. here the code (the id
spreadsheet
is 'ss':

sub ss_dblclick()
Dim cmContextMenu(4)
Dim cmClearSubMenu(2)
cmClearSubMenu(0) = Array("All", "ClearAll")
cmClearSubMenu(1) = Array("Formats", "ClearFormats")
cmClearSubMenu(2) = Array("Values", "ClearValues")
cmContextMenu(0) = Array("Cut", "owc2")
cmContextMenu(1) = Array("Copy", "owc3")
cmContextMenu(2) = Array("Paste", "owc4")
cmContextMenu(3) = Empty cm
ContextMenu(4) = Array("Clear", cmClearSubMenu)
ss.ShowContextMenu 10,40, cmContextMenu
end sub


This code is correct, with ss_dblclick or ss_click, but I tried as you
said
with ss_contextmenu... but nothing done...
I don't understant. I tried also ss_oncontextmenu, and
ss_beforecontextmenu,
but it doesn't resolve my probleme.

I didn't learn vb script, but perhaps, I can retrieve the right click.
Don't
you? Thanks.

After, I prefer translate the code in javascript language in order to keep
the coherence between my different pages.

Thanks for your help.


"cui" <cuisystem@_with-provider----free.fr> a écrit dans le message de
I thank you.

But I don't understand something...

I work with javascript language...

I have a spreadsheet object. And I attach some events like this:
myspreadsheet.AttachEvent("BeforeContextMenu", fct_beforeContextMenu)
;
myspreadsheet.AttachEvent("DblClick", fct_DblClick) ;

and
function fct_DblClick() { alert("HELLO") ; }
function fct_beforeContextMenu(x,y, mnu, value) {alert("HELLO") ; }

When I dble click on a cell, I have correctly the hello message. But
impossible with the right click.... Then, I ask me if if don't use
another
handler than beforeContextMenu, but which one?

Thanks.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le
message
de you can get to the menu thru events in visual basic client side

spreadsheetname_contextmenu()
code goes here

You will need to redim an array to add values to the menu. The array
will
hold the current items in the menu plus your own personal items.
Wire
your
menu item to code via the click event.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi,

I want to know how I can retrieve the context menu of the OWC
spreadsheet
(version 10).

Thanks
 
C

cui

Listen me Mr MVP, I will learn something...

OK, without you, I will not find my solution...
To put the context menu of the spreadsheet compounent in using javascript, I
proceed like this:

1/ I have a function init. In this function I attach the beforecontextmenu
event like this : window.Form1.ss.attachEvent("beforecontextmenu",
ss_showContextMenu) ;
2/ I write the handler of this event. The declaration handler must obviously
respect the main signature: function ss_showContextMenu(x,y,mnu,cancel)
3/ To manipulate the context menu, as I can seen it on a microsoft website:
var sarrNewMenu ;
var vbarrMenu = new VBArray(mnu.Value) ;
var sarrMenu = vbarrMenu.toArray() ;
var vbarrMenuItem ;
var sarrMenuItem ;
sarrNewMenu = new Array(sarrMenu.length) ;
var i ;
for (i = 0 ; i < sarrMenu.length ; i++) {
if (sarrMenu != null) {
vbarrMenuItem = new VBArray(sarrMenu) ;
sarrMenuItem = vbarrMenuItem.toArray() ;
if (sarrMenuItem[1] == 1001) { sarrNewMenu = new Array("CUI",
"mnuCUI") ; }
else { sarrNewMenu = sarrMenuItem ; }
} else { sarrNewMenu = null ; }
} mnu.Value = sarrNewMenu ;

NOTE: this example replace the 'cut' element. We must use the VBArray (I
don't remember exactly the reason....)

Then, we have the context menu as we (I) want.
4/ To execute the new command, we also add an handler to the commandexecute
event, in the init function for example:
window.Form1.ss.attachEvent("commandExecute", ss_commandExecute) ;
5/ We write the handler, and we test the vCommand parameter...
function ss_commandExecute(vCommand, fsucceeded) {
if (vCommand =="mnuCUI") { alert("IT'S GREAT") ;
}


That's all. It is not difficult when you know :)))

I thank you for your help.

cui.


Alvin Bruney said:
sp_BeforeContextMenu(x, y, Menu, Cancel)
is what you are after. this fires before the menu appears. you can put your
code in there to customize the menu when the user clicks the right mouse
button

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
OK. I trust in you. And therefore I'll use the vb script.

But I can't display a context menu on the click event, but not in the
contextmenu or on the right-click. Thanks. For today, I will create a new
button above the spread sheet control.

Thanks for your help.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le
message
de news:[email protected]...
the javascript way of trapping events is a bit involved. I don't have the
code with me as I am at home right now. I can look it up tomorrow. It's
easier done with vbscript which is why i recommended it in the first place.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

I follow an example found in OWCVBA10.Chm. here the code (the id
spreadsheet
is 'ss':

sub ss_dblclick()
Dim cmContextMenu(4)
Dim cmClearSubMenu(2)
cmClearSubMenu(0) = Array("All", "ClearAll")
cmClearSubMenu(1) = Array("Formats", "ClearFormats")
cmClearSubMenu(2) = Array("Values", "ClearValues")
cmContextMenu(0) = Array("Cut", "owc2")
cmContextMenu(1) = Array("Copy", "owc3")
cmContextMenu(2) = Array("Paste", "owc4")
cmContextMenu(3) = Empty cm
ContextMenu(4) = Array("Clear", cmClearSubMenu)
ss.ShowContextMenu 10,40, cmContextMenu
end sub


This code is correct, with ss_dblclick or ss_click, but I tried as you
said
with ss_contextmenu... but nothing done...
I don't understant. I tried also ss_oncontextmenu, and
ss_beforecontextmenu,
but it doesn't resolve my probleme.

I didn't learn vb script, but perhaps, I can retrieve the right click.
Don't
you? Thanks.

After, I prefer translate the code in javascript language in order to keep
the coherence between my different pages.

Thanks for your help.


"cui" <cuisystem@_with-provider----free.fr> a écrit dans le message de
I thank you.

But I don't understand something...

I work with javascript language...

I have a spreadsheet object. And I attach some events like this:
myspreadsheet.AttachEvent("BeforeContextMenu", fct_beforeContextMenu)
;
myspreadsheet.AttachEvent("DblClick", fct_DblClick) ;

and
function fct_DblClick() { alert("HELLO") ; }
function fct_beforeContextMenu(x,y, mnu, value) {alert("HELLO") ; }

When I dble click on a cell, I have correctly the hello message. But
impossible with the right click.... Then, I ask me if if don't use
another
handler than beforeContextMenu, but which one?

Thanks.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le
message
de you can get to the menu thru events in visual basic client side

spreadsheetname_contextmenu()
code goes here

You will need to redim an array to add values to the menu. The array
will
hold the current items in the menu plus your own personal items.
Wire
your
menu item to code via the click event.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi,

I want to know how I can retrieve the context menu of the OWC
spreadsheet
(version 10).

Thanks
 
A

Alvin Bruney [MVP]

It is not difficult when you know :)))
very true


--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
Listen me Mr MVP, I will learn something...

OK, without you, I will not find my solution...
To put the context menu of the spreadsheet compounent in using javascript,
I
proceed like this:

1/ I have a function init. In this function I attach the beforecontextmenu
event like this : window.Form1.ss.attachEvent("beforecontextmenu",
ss_showContextMenu) ;
2/ I write the handler of this event. The declaration handler must
obviously
respect the main signature: function ss_showContextMenu(x,y,mnu,cancel)
3/ To manipulate the context menu, as I can seen it on a microsoft
website:
var sarrNewMenu ;
var vbarrMenu = new VBArray(mnu.Value) ;
var sarrMenu = vbarrMenu.toArray() ;
var vbarrMenuItem ;
var sarrMenuItem ;
sarrNewMenu = new Array(sarrMenu.length) ;
var i ;
for (i = 0 ; i < sarrMenu.length ; i++) {
if (sarrMenu != null) {
vbarrMenuItem = new VBArray(sarrMenu) ;
sarrMenuItem = vbarrMenuItem.toArray() ;
if (sarrMenuItem[1] == 1001) { sarrNewMenu = new Array("CUI",
"mnuCUI") ; }
else { sarrNewMenu = sarrMenuItem ; }
} else { sarrNewMenu = null ; }
} mnu.Value = sarrNewMenu ;

NOTE: this example replace the 'cut' element. We must use the VBArray (I
don't remember exactly the reason....)

Then, we have the context menu as we (I) want.
4/ To execute the new command, we also add an handler to the
commandexecute
event, in the init function for example:
window.Form1.ss.attachEvent("commandExecute", ss_commandExecute) ;
5/ We write the handler, and we test the vCommand parameter...
function ss_commandExecute(vCommand, fsucceeded) {
if (vCommand =="mnuCUI") { alert("IT'S GREAT") ;
}


That's all. It is not difficult when you know :)))

I thank you for your help.

cui.


"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le
message
de news:[email protected]...
sp_BeforeContextMenu(x, y, Menu, Cancel)
is what you are after. this fires before the menu appears. you can put your
code in there to customize the menu when the user clicks the right mouse
button

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
cui said:
OK. I trust in you. And therefore I'll use the vb script.

But I can't display a context menu on the click event, but not in the
contextmenu or on the right-click. Thanks. For today, I will create a new
button above the spread sheet control.

Thanks for your help.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans le
message
de the javascript way of trapping events is a bit involved. I don't have the
code with me as I am at home right now. I can look it up tomorrow.
It's
easier done with vbscript which is why i recommended it in the first
place.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

I follow an example found in OWCVBA10.Chm. here the code (the id
spreadsheet
is 'ss':

sub ss_dblclick()
Dim cmContextMenu(4)
Dim cmClearSubMenu(2)
cmClearSubMenu(0) = Array("All", "ClearAll")
cmClearSubMenu(1) = Array("Formats", "ClearFormats")
cmClearSubMenu(2) = Array("Values", "ClearValues")
cmContextMenu(0) = Array("Cut", "owc2")
cmContextMenu(1) = Array("Copy", "owc3")
cmContextMenu(2) = Array("Paste", "owc4")
cmContextMenu(3) = Empty cm
ContextMenu(4) = Array("Clear", cmClearSubMenu)
ss.ShowContextMenu 10,40, cmContextMenu
end sub


This code is correct, with ss_dblclick or ss_click, but I tried as you
said
with ss_contextmenu... but nothing done...
I don't understant. I tried also ss_oncontextmenu, and
ss_beforecontextmenu,
but it doesn't resolve my probleme.

I didn't learn vb script, but perhaps, I can retrieve the right click.
Don't
you? Thanks.

After, I prefer translate the code in javascript language in order
to
keep
the coherence between my different pages.

Thanks for your help.


"cui" <cuisystem@_with-provider----free.fr> a écrit dans le message de
I thank you.

But I don't understand something...

I work with javascript language...

I have a spreadsheet object. And I attach some events like this:
myspreadsheet.AttachEvent("BeforeContextMenu", fct_beforeContextMenu)
;
myspreadsheet.AttachEvent("DblClick", fct_DblClick) ;

and
function fct_DblClick() { alert("HELLO") ; }
function fct_beforeContextMenu(x,y, mnu, value) {alert("HELLO") ; }

When I dble click on a cell, I have correctly the hello message.
But
impossible with the right click.... Then, I ask me if if don't use
another
handler than beforeContextMenu, but which one?

Thanks.

"Alvin Bruney [MVP]" <vapor at steaming post office> a écrit dans
le
message
de you can get to the menu thru events in visual basic client side

spreadsheetname_contextmenu()
code goes here

You will need to redim an array to add values to the menu. The array
will
hold the current items in the menu plus your own personal items.
Wire
your
menu item to code via the click event.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi,

I want to know how I can retrieve the context menu of the OWC
spreadsheet
(version 10).

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top