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
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
Thank you for your reply
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.
Regards, Jon Summers LA Solutions
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
Hello,
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, ""},
OK, there is your difference: ALIGN_LEFT vs. ALIGN_RIGHT for the 2nd and 3rd column, and I don't see a TREEATTR_NOELLIPSES in the combination of the attributes.
Nonetheless, I see that it is not well documented (TREEATTR_NOELLIPSES is even not in the documentation, header file only), and without even testing anything here, that the combination of those attribs might easily lead to confusion, even because you have to define one attrib for the whole tree, not for each column, where different styles might be usefull with each of them.
Unfortunately I currently don't have an app to make some tests (use mfc dialogs, which have their own cons), but I expect Jon or Chris to easily provide additional information.
Said so, I still expect this to be a change in standard behaviour, while it is even undocumented.
I tried to add the TREEATTR_NOELLIPSES attribute, but I got a compilation error "undeclared variable". So, what is the header file name which contains this attribute definition?
Also, what do you mean by "while it is even undocumented.", is it the MS V8i SQERIES 3 ?
If you got an compiler error, than there is a good chance that this attrib was introduced in SS3. It is only in dlogbox.h and there is no documentation about a different behaviour, nor is this attribute described in the MDLProgrammerGuide or readmeSDK. As I have only the SS3 SDK installed I cannot say if it is available in previous versions, but I think it isn't.
But, even if I include the dlogbox.h file, the compilation error always occurs. I opened the dlogbox.h file in order to look for the definition of TREEATTR_NOELLIPSES attribute, but it does not exist in this file.
HELLO Jon
So, considering these new details and exchanges, do you have other suggestions for solving the problem.