Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: uisetcolor + activeX ->figure without focus, if compiled
Date: Fri, 13 Mar 2009 14:34:01 +0000 (UTC)
Organization: Rieter Automotive Management AG
Lines: 31
Message-ID: <gpdqsp$29p$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1236954841 2361 172.30.248.37 (13 Mar 2009 14:34:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 13 Mar 2009 14:34:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 562591
Xref: news.mathworks.com comp.soft-sys.matlab:524610


Hallo,

I'm using uisetcolor in combination with an activeX. 
If my application is compiled, I'm loosing the focus of the figure and can't get it back, after using the uisetcolor command.

The following code works fine, if not compiled.
I compile with the Compiler version: 4.10 (R2009a):
mcc -mv test3.m

In the example I use the MS Excel Spreadsheet. But I had the same effect using another ActiveX.

Has somebody experienced something like this?

Andreas
----------------------------
function test
f=figure;
 uicontrol('Parent',f,'Style', 'pushbutton',...
    'Position', [0 0 130 30],'String','Color',...
    'CallBack',@color_Callback);
actxcontrol('OWC.Spreadsheet.9', [150 150 300 300],f);
return

function color_Callback(hObject, eventdata, handles)
  c1=get(gcf,'Color');
  c = uisetcolor(c1, 'Entity color');
  disp('HALLO') ;
  if sum(c1==c)<3
    set(gcf,'Color',c);
  end
return