How to set the size of MTextBox?

User a83cdfbe8a

02-12-2010 08:49:57

Hi,when I create a  reaction from Marvin as picture 3, and then use this reaction to create a picture with the following java code , if the red line operations ,create the picture as picture 1, else ,create the picture as picture 2.


How can display complete information of the MTextBox?


java code:


MDocument doc = mol.getDocument();


for (int i = 0; i < doc1getObjectCount(); i++) {


    MObject ob1=doc.getObject(i);


   if (ob1 instanceof MTextBox) {


    ((MTextBox)doc.getObject(i)).setFontScale(16.0);


    ((MTextBox)doc.getObject(i)).setAutoSize(true);


   }


  } 


Thank you !

ChemAxon d26931946c

02-12-2010 14:17:30

Hi!


When a textbox is created  in Marvin, the default font size is 10. You can change it at the Text toolbar at the bottom of the canvas. 


If fontsite is set from API and the textbox.setAutosize(true) is set the textbox calculates the width of the text. The  box keeps the top-left corner. 


If the autosize option is set to false and the box is too narrow to fit the text, the text is not shown properly. There is no auto-line breaking algorithm in Marvin at the moment.


 


To fix this problem the font size should be set from Marvin and the position of the textbox should be set from GUI too.


If you have any more question please let me know.


 


Best regards, 


Peter

User a83cdfbe8a

03-12-2010 00:58:41










gezapeti wrote:

Hi!


When a textbox is created  in Marvin, the default font size is 10. You can change it at the Text toolbar at the bottom of the canvas. 


If fontsite is set from API and the textbox.setAutosize(true) is set the textbox calculates the width of the text. The  box keeps the top-left corner. 


If the autosize option is set to false and the box is too narrow to fit the text, the text is not shown properly. There is no auto-line breaking algorithm in Marvin at the moment.


 


To fix this problem the font size should be set from Marvin and the position of the textbox should be set from GUI too.


If you have any more question please let me know.


 


Best regards, 


Peter




Hi!


   in Marvin, the default font size is 10. What can I do for setting  the default font size to 16?Everytime,I open Marvin, the default font size changes from  16 to 10. looks like "msketch_param("molbg", "#F0F0F0");"


Thanks.


Cuidong

ChemAxon d26931946c

06-12-2010 16:14:45

Hi!


Setting the default font size is not possible at the moment.


We are planning to implement this setting. 


We will let you know when the new feature will be available.


Best regards, 

Peter