We are a company that uses Microstation software to deploy our own solution “DKmètre“ that we have developed with the C and MDL languages.
Our solution is compatible with the series 1 and 2 of the Microstation 8i version. However, updating Microstation to have the series 3 causes a bug in our application.
All texts which are displayed using the mdlTreeCell_setDisplayText fontion do not appear correctly, the last characters of words are replaced by ellipsis.
You will find attached a screen capture of our application, the words that are circled in red represent the bug.
Has someone have this kind of bugs?
Thank you for your help
Unknown said:The last characters of words are replaced by ellipsis
Perhaps the Dialog Manager thinks your text is too wide for that column. It's truncating the text and concatening the ellipsis to fit the column width.
Does the text display correctly if either you...
There may also be attributes applicable to the TreeView that you can change in your dialog resource (.r) file. In your case, TREEATTR_NOELLIPSES looks a good place to start.
#include <dlogbox.h>
#define TREEATTR_NOELLIPSES 0x80000000 // Columns will not show ellipses when truncated
Regards, Jon Summers LA Solutions
Hello,
Thank you for your reply
You have said: Does the text display correctly if either you...
1.Provide a shorter string
If I provide a string which is composed of less than 5 characters, it’s displayed correctly. But, from 5 characters, the last 4 characters are always truncated and replaced by ellipsis.
Example: 12345 --> 1… ; 12345678 --> 1234… etc
2. Widen the column
Even if I wide the column, the problem always occurs .
3. There may also be attributes applicable to the TreeView that you can change in your dialog resource (.r) file.
I’d like to note that those dialog resource work correctly in the microstation8i series 1 and 2.
this next picture is taken from the DKmètre application deployed on the series 2 of microstation8i.
If I was you, I would follow Jon's advice about attributes. The thing is that knowing the offending attribute may give a valuable hint about the origin of this problem.
Since you have access to sources, you can easily eliminate TREEATTR_... one by one recompiling each time until the problem hopefully disappears (or severes).
Another thing to try is to remove the active *.upf file while uStn is not running (i.e. file with saved user preferences, usually buried in a weird place (like on XP it is \Documents and Settings\username\Local Settings\Application Data\Bentley\Microstation\8.11\whatever\...) and retesting. It may be uStn misinterpreting the saved configuration.
Cheers,
/Chris Z.
Hello Chris
I'm going to test the 2 solutions that you suggest.
Concerning the second solution, do I have to remove all the files with the upf’s extension?
Unknown said:Do I have to remove all the files with the upf’s extension?
Only the .upf for the current user workspace. You can find the current user workspace (.ucf) from MicroStation's Workspace|Configuration menu.
Hello
I tried the 2 solutions that you suggested, but the problem always persists. I’d like to inform you that in the same form and using a same component (Ex: TEXT resource), some texts are written correctly and others are truncated, which means that this display bug is not due to the tree view’s attributes.
See the figure below:
From the picture above, it seems that the 2nd column is correct while the 3rd is not ! How do you create them ? What are the differences between them ? Have you applied the same attributes to both of the columns ? I would expect the mentioned TREEATTR... to be applied to the ditem_treecolumrsc (not only the tree itself) or (if used) mdlDialog_treeInsertColum() function.
HTH Michael
Concerning your first question: “How do you create columns?”
Columns are created using the code below :
We use in each case “ mdlTreeNode_getCellAtIndex “ in order to add a new column.
I’d like to note that the “DkmModeleVues_afficheChamp” function do some treatments and calls the “mdlTreeCell_setDisplayText” function.
#define COLFICHE_LIBELLE 0
#define COLFICHE_VALEUR1 1
#define COLFICHE_VALEUR2 2
/*********************************************************/
GuiTreeNode *pNode = NULL;
GuiTreeCell *pCell = NULL;
pNode = mdlTreeNode_create( explorateur.fl[FL_MODELEVUE].ficheModel, FALSE );
pCell = mdlTreeNode_getCellAtIndex( pNode, COLFICHE_LIBELLE);
mdlTreeCell_setDisplayText( pCell, "Nouveau" );
pCell = mdlTreeNode_getCellAtIndex( pNode, COLFICHE_VALEUR1 );
DkmModeleVues_afficheChamp( pCell, FICHEMODELEVUE_PASDEPROFIL, noModeleVue );
DkmExplorateurFiche_setEditor( pCell, RTYPE_Text, TEXTID_ModeleVues_Fiche );
pCell = mdlTreeNode_getCellAtIndex( pNode, COLFICHE_VALEUR2 );
DkmModeleVues_afficheChamp( pCell, FICHEMODELEVUE_EMPRISEDROITE, noModeleVue );
About your second question: “What are the differences between them?”
There is no difference between them, we just change the number passed as an argument to the function “mdlTreeNode_getCellAtIndex”.
About your third question “Have you applied the same attributes to both of the columns?”
I don’t think that we use attributes for treecolumn item.
I’d like to note one more time that our application operates correctly with microstation v8i serie 2, this display bug appear just with the serie 3.
So, can it be due to a new configuratuion in the microstation serie 3 ?
Thank you
cdiTech ...
So you just showed me how you fill values in the columns, but not how you create them. What is the definition of your columns in the .rsc files ? There might be changes in the standard behaviour between SS2 and SS3, but that is not a bug, this is what attributes are for. You can exactly define the behaviour in your ressource (or the dynamic creation functions). If you don't use them, then you might experience changes. No one guaranties that the standard behaviour keeps the same over different versions. There might be new insights, that make a abbreviation more common, than showing the full text.
As Chris and Jon have more experience with pure MicroStation dialogs than me, it would be a good idea to show an excerpt of your resource for this tree and his columns.
Michael
This is an excerpt of my resource file, the script below is responsible for creating columns:
DItem_ContainerRsc CONTAINERID_ModeleVues =
{
NOCMD, LCMD, NOHELP, MHELP, NOHOOK, NOARG, 0,
DILISTID_ModeleVues
};
DialogItemListRsc DILISTID_ModeleVues =
{{0,10*YC,0,0}, Tree, TREEID_ModeleVues_Fiche, ON, 0, "", ""},
{{0,10*YC,0,0}, Sash, SASHID_ExplorateurHorizontal, ON, 0, "", ""},
{{0,10*YC,0,0}, ListBox, LISTBOXID_ModeleVues_Liste, ON, 0, "", ""},
}
/*Creating columns*/
DItem_TreeRsc TREEID_ModeleVues_Fiche =
NOHELP, MHELP,
HOOKITEMID_ModeleVues_Fiche, NOARG,
TREEATTR_DYNAMICSCROLL | TREEATTR_LINESDIM | TREEATTR_LINESDOTTED | TREEATTR_EDITABLE |
TREEATTR_NOSHOWROOT | TREEATTR_DOUBLECLICKEXPANDS | TREEATTR_FOCUSOUTLOOK | TREEATTR_HORIZSCROLLBAR |
TREEATTR_RESIZABLECOLUMNS ,
10, 0, "",
{0, 30*XC, 255, ALIGN_LEFT, " "},
{0, 25*XC, 255, ALIGN_LEFT, ""},
{0, 8*XC, 255, ALIGN_RIGHT, ""},
{0, 1, 1, ALIGN_LEFT, ""},