[gme-users] Redraw decorator when object attribute changes

Peter Volgyesi peter.volgyesi at vanderbilt.edu
Mon Mar 21 08:46:17 CST 2005


Hi,
 
You can look up MGA error codes in the Mga.idl file (located in the
Interfaces folder of your GME installation). 
"Your" error code means: E_MGA_NOT_IN_TRANSACTION ("Operation must execute
within transaction"). The slight modification, you've made caused this
problem: in the initalize method you will find other lines
initating/commiting transactions. Generally, it is a bad idea to query to
model database in the draw method anyway (it is slow)
I highly suggest to read (at least the beginning of) the "MGA Library"
documentation (Mga.pdf) if you're into decorator development.
--
Peter Volgyesi
ISIS, Vanderbilt University


  _____  

From: gme-users-bounces at list.isis.vanderbilt.edu
[mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Yi Chu
Sent: Sunday, March 20, 2005 10:44 PM
To: Matthew J. Emerson; gme-users
Subject: Re: [gme-users] Redraw decorator when object attribute changes


Hi Matthew,
 
Thank you very much. I tried a piece of code (modified from the class for
the UML) as follows in the Draw method of the decorator class and it throws
an exception #0x87650035. I don't know what this exception code means.
///////////////////////////////////////////////
CComPtr<IMgaFCO> mgaFco = m_mgaFco;
CComBSTR attr("test");    //the name of the Boolean type attribute
VARIANT_BOOL bVal;
 
try {
     COMTHROW(mgaFco->get_BoolAttrByName(attr,&bVal));
}
catch (hresult_exception &ee) {
    AfxMessageBox(ee.what());
}
////////////////////////////////////////////
 
The only difference between my code and the UML class decorator code is that
the latter one is in the method Initialize(), while my code is in Draw(). It
seems that the value of the FCO's attribute can only be retrieved during
initialization of this decorator object. But I want to let the decorator to
display according to the dynamically changed attribute value.
 
Any ideas?
 
Yi
 

----- Original Message ----- 
From: Matthew J. Emerson <mailto:mjemerson at isis.vanderbilt.edu>  
To: Yi Chu <mailto:y.chu at sympatico.ca>  ; gme-users
<mailto:gme-users at list.isis.vanderbilt.edu>  
Sent: Sunday, March 20, 2005 5:25 PM
Subject: RE: [gme-users] Redraw decorator when object attribute changes


Hi Yi Chu,

 

I don't much about decorators, but you might consider looking at the
decorator code for the UML class diagrams environment which ships with GME.
That decorator changes the visualization of each Class instance to reflect
the attribute names and types listed in a string attribute.

 

--Matt

 


  _____  


From: Yi Chu [mailto:y.chu at sympatico.ca] 
Sent: Sunday, March 20, 2005 1:31 PM
To: gme-users
Subject: [gme-users] Redraw decorator when object attribute changes

 

Hello,

 

I wanted to change the shape of the decorator for an atom object in my model
according to the current value of an attribute. I am thinking of using the
Draw() method of the CDecorator class that is generated with "decorkit.zip"
to do the work. Is it possible that I get access to the current object's
attribute in this Draw() method? I tried to use
"m_mgaFco->get_AttributeByName()" but it seemed does not work for me.  

 

Many thanks in advance.

Yi Chu



  _____  




No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.7.3 - Release Date: 3/15/2005


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20050321/381482be/attachment.htm


More information about the gme-users mailing list