11.0.1 - VistaTaskDialog not Finished! |
Post Reply |
Author | |
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
Posted: 24 April 2007 at 12:54pm |
Hi All! From the moment I saw VistaTaskDialog, I loved it. This is something I was waiting from you guys ever since I got my first Vista OS. While walking through features of the example, it occurred to me that since all design of any TaskDialog is pre-programmed, based on parameters, it would be all-natural to load its initialization from an XML file, and I even was about to sketch out a schema for it using XML, as all-of-a-sudden I find you do use XML already, I was fascinated by this fact! But as I continued studying the XML, I couldn’t help noticing one key thing: it is not valid!. How is it possible, I am asking myself? Did you guys sketch its structure on a paper box and then decided to completely forget what Valid XML is all about? I mean come-on, you are the ones like nobody else in the position to set the trend and style in coding, so how on earth could let this one slide in such a lame way? I can’t believe it! This idea MUST prosper, it MUST develop, which means two things:
Chins up, two more steps, and you will deserve all the appraisals there yet to come for it! |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
A few more specific suggestions...
1. I suggest the TDX (Task Dialog XML) file extension for such files when they become a Valid XML.
2. A designer, called "TDX Designer" to create such files and edit existing ones.
3. Not sure if you do not have yet, but it MUST support dynamic context, i.e. specifying some text anchors within XML text data instead of the actual text, and then fire events within the library to get such text on-the-fly.
Regards,
Vitaly
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
you can download XML editor for dialog:
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Thank you,
I have looked at it, and I saw the same problem - Not Valid XML. And because it is not valid, CodeJock's variation of it differs from the one that TDPad authors suggested:
In their TDPad Help they mention that attributes PHeader, TDHeader and IdRange are required for tag Dialogs, while you do not use them in your CodeJock's examples at all.
This is a typical kind of mess that happens when using a Non-Valid XML.
One must develop a proper format and proper XML schema for such documents, because otherwise a question arises: Why any company should invest money and time in designing UI using some unknown-format file, which can change tomorrow and then i'm stuck with a load of unusable XML files...
This is serious... I would urge to attend this matter very soon...
This is not something a Microsoft partner would let get through. Microsoft doesn't produce invalid XML these days, and neither should you.
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Also consider this: This TaskDialog will evenetually have XML features supported in .NET, which will mean even more trouble working with non-valid XML. And then imagine other will want to create proper designers for your XML files, but once again they won't, for the format isn't finished. I have a proposal for you guys: I am an expert in designing XML schemas, and document analysis, so i can do this for you (for free of course), and for the good of all developer community. If interested, contact me by email.
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
In the meantime, I encountered a serious bug in class CXTPTaskDialog, method CreateFromResource where on the third line it calls AfxGetInstanceHandle() instead of AfxGetResourceHandle(), and as a result of which, it is impossible to load the XML from the default resource file, if it is not the EXE itself.
The are many projects out there just like mine, that store all resources in a sepaerate DLL for easier localization. For all of them, including myself, it is impossible to load XML from resources, which is supposed to be the key feature of the class...
Please provide the fix ASAP!!!
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
P.S. I find it very important that the class allows loading XML from:
1. Default resource file
2. Custom resource file
3. External File
Currently, it is very unflexible...
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Another big bug in CXTPTaskDialog
I'm using multi-line text for the Contents of the Task Dialog, and i've just founf out that while Vista processes <br/> statements for that within Contents, and displays '\n' as is, your class CXTPTaskDialog works just the other way round: It uses \n, and it knows nothin about <br/>
I bet there will be more problems with this class, so i'll have to wait till you guys fix all the issues first...
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
I see your point with resources. We added
BOOL CreateFromResource(UINT nIDResource, LPCTSTR lpszDialog);
BOOL CreateFromResource(HINSTANCE hInstance, UINT nIDResource, LPCTSTR lpszDialog); BOOL CreateFromResourceParam(HINSTANCE hInstance, UINT nIDResource, LPCTSTR lpszDialog, LPCTSTR const* rglpsz, int nString);
methods. You can patch your sources now:
BOOL CXTPTaskDialog::CreateFromResource(UINT nIDResource, LPCTSTR lpszDialog)
{ return CreateFromResource(AfxGetInstanceHandle(), nIDResource, lpszDialog); } etc
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
First look to the schema: <?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Dialogs"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Dialog"> <xs:complexType> <xs:sequence> <xs:choice maxOccurs="unbounded"> <xs:element name="WindowTitle" type="xs:string" maxOccurs="1" /> <xs:element name="MainInstruction" maxOccurs="1"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Image" type="xs:string" use="optional" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="Verification" maxOccurs="1"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Checked" type="xs:boolean" use="optional" default="false" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="Content" type="xs:string" maxOccurs="1" /> <xs:element name="ExpandedInformation" maxOccurs="1"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Footer" type="xs:boolean" use="optional" default="false" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="ExpandedText" type="xs:string" maxOccurs="1" /> <xs:element name="CollapsedText" type="xs:string" maxOccurs="1" /> <xs:element name="RadioButtons" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="RadioButton"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="ID" type="xs:long" use="required" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="Default" type="xs:long" use="required" /> </xs:complexType> </xs:element> <xs:element name="Buttons" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="Close" /> <xs:element minOccurs="0" name="Yes" /> <xs:element minOccurs="0" name="No" /> <xs:element minOccurs="0" name="Ok" /> <xs:element minOccurs="0" name="Retry" /> <xs:element minOccurs="0" name="Cancel" /> <xs:element minOccurs="0" maxOccurs="unbounded" name="CommandLink"> <xs:complexType> <xs:sequence> <xs:element name="Text" type="xs:string" /> <xs:element name="Explanation" type="xs:string" use="optional" /> </xs:sequence> <xs:attribute name="Shield" type="xs:boolean" use="optional" /> <xs:attribute name="ID" type="xs:long" use="required" /> </xs:complexType> </xs:element> <xs:element minOccurs="0" maxOccurs="unbounded" name="Button"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="ID" type="xs:long" use="required" /> <xs:attribute name="Shield" type="xs:boolean" use="optional" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="Default" type="xs:long" use="optional" /> </xs:complexType> </xs:element> <xs:element name="Footer" maxOccurs="1"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Image" type="xs:string" use="optional" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:choice> </xs:sequence> <xs:attribute name="Name" type="xs:string" use="required" /> <xs:attribute name="EnableHyperlinks" type="xs:boolean" use="optional" /> <xs:attribute name="AllowCancel" type="xs:boolean" use="optional" /> <xs:attribute name="ProgressBar" type="xs:boolean" use="optional" /> <xs:attribute name="Width" type="xs:long" use="optional" /> <xs:attribute name="RelativeToWindow" type="xs:boolean" use="optional" /> <xs:attribute name="RTLLayout" type="xs:boolean" use="optional" /> <xs:attribute name="NoDefaultRadioButton" type="xs:boolean" use="optional" /> <xs:attribute name="MessageBoxStyle" type="xs:boolean" use="optional" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Thank you, Oleg.
There first was a problem opening the schema, because of the following line:
< xs:element name="Explanation" type="xs:string" use="optional" />"element" does not accept attribute "use", my schema viewer says (Altova XML Spy). I just removed "use", i could open it.
The schema looks generally quite finished, but it does have some logical problems, plus no documentation, plus no proper limits set...
Anyways, it's better for me as a start, faster to finish. But now i will have to go through it step-by-step, through all the elements, to assure 100% correctness. With a little help from your side on some elements i should finish it this week...
I see that you chose TDPad project as a basis, but then you deviated from it with your attributes for the root element Documents, i.e. you have different attrbutes on which i don't know if you provide any documentation, but we'll figure it out....
Cheer'o!
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
ok, thanks, waiting finished schema from you.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Couple questions about tasg Dialogs....
1. Attribute MessageBoxStyle was introduced by CodeJock for tag Dialog. It doesn’t seem beneficial to the concept, because it relates exclusively to CodeJock’s theme support. When making this a standard and working out a schema, doesn’t seem justified to be present in the schema. It is probably best to be just a property within class CXTPTaskDialog, and not to be read from the XML at all. What do you think? 2. For tag Dialog you are missing two attributes that were suggested in the original TDPad specification: NoCommandLinkGlyph and UseTDCallback. I am tempted to include these, while leaving this up to you whether or not you are going to implement them. Again, what do you think about it? |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Also, attributes for tag Dialogs do not seem to be justified either. By all logic they are to be within a profile for generating files, internal to the TDPad software, certainly not embedded into the XML file.
So, i'm leaving Dialogs without any attribute, which corresponds to the codejock's implementation...
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
yes NoCommandLinkGlyph is used now, please add it. Don't see what UseTDCallback can do, because CXTPTaskDialog always use callbacks.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
And what about that MessageBoxStyle attribute that I asked as well? Some default values are not certain. It seems that TDPad suggested True by default for ExpandedInformation, attribute Footer, while in your schema it is set to False by default. Which one it should be? Other default I’m setting for tag Dialog: EnableHyperlinks: false AllowCancel: False ProgressBar:false RelativeToWindow:false RTLLayout:false NoDefaultRadioButton:false Width:0 MessageBoxStyle (perhaps should be removed altogether) |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
G’Day, Please answer all those questions above to let me finish the schema properly. Here’s its current reincarnation, just to show how things are shaping up in the meantime: http://www.neatcpp.com/TDSchema.gif Regards, Vitaly |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
ExpandedInformation and Footer have False as default,
include MessageBoxStyle with False as defaul.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Thank you. I should finish it off very soon now...
Regarding your post:
I don't understand the meaning of the last method. It's supposed to be something like BOOL CreateFromFile(LPCTSTR lpsFilePath, LPCTSTR lpszDialog); to load from a file...
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Hi Oleg, Here’s the finished Task Dialog Schema: http://www.neatcpp.com/TDSchema.xsd For best practices, CodeJock should allocate a fixed namespace for it on its website, such as http://www.codejock.com/schema/TDSchema.xsd Towards the end of the design, I wasn’t as sure about some elements that were added to it, because CodeJock went away from the original standard a few steps, namely:
Of course, TDPad was far from perfect and had even more specifics that no-one actually needs, and generally irrelevant to the Task Dialog concept, such as all those attributes for root tag Dialogs. So, one might say that what we got is a compromise based on the common sense. Note that in my last review I also added attribute Expanded in tag ExpandedInformation, which was also missed in the original schema that I was given. If you are using a proper XML Schema designer, like Altova XML Spy, you will be able to see that not only I documented all the elements and their attributes, but also I provided a complete application-type documentation on them I accordance with information given and the CodeJock library and documentation that comes with TDPad. There’s one rudimentary element to the schema, which allows defining a logical anomaly – the choice between elements Button and CommandLink must be exclusive. Unfortunately, if we follow the original tag structure, it is impossible to implement in the schema. And for the way that it is possible to implement there, well, this would be another step away from the original tag structure, and I’m not sure if CodeJock team will support it, and I don’t want my efforts wasted otherwise. So, let me know whether you feel like reconsidering the tag structure change towards complete error-free validation or not, so I can change it then… Well there you go. I will be looking forward to your next release of the library where you fixed all the bugs, such as:
And keep up good work! Cheer’o! |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Thanks for help, Vitaly.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Hi Oleg,
As my company was approaching a new software release, i found out that thouhg i use an embedded XML for Task Dialogs, our translation tools (Visual Localize) won't be able to automate translation for such. Now we are forced to use an external XML file for that. Otherwise, i'll have to dumb all the nitty-gritties of TD, which i'd hate to do, we are quite fixed on it now :)
Could you, please provide implementation for method CreateFromFile as soon as possible?
Thank you!
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Oleg, no rush, it turned out very easy to do it myself through a derived class that i called CXTPTaskDialogEx, and mainly by removing all the resource processing and replacing call to px.LoadFromString with px.LoadFromFile as shown i the code below, which i tested and it works....
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Hi Oleg,
As I was implementing all kinds of Task Dialogs, I found one bug in the schema: For tag Buttons, attribute Default must be of type string, not long, because it also accepts standard button names, like Ok, etc...
I have fixed it and uploaded to http://www.neatcpp.com/schema/TDSchema.xsd
When you upload it onto your website, do not forget to change neatcpp domain in the header into codejock, and please let me know here when it's done!
Sorry for that, but everything needs testing, as you know...
And now that i see all my TDX files validate fine - "me feelin happy" :)))
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Think long is ok. anyway string will not be parsed in our code - For OK use Id - 1, foc cancel 2 etc. (IDOK, IDCANCEL...);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Huh, ok. I was simply relying on the TD examples that i had at hand. And i thought it did make perfect sense to recognize the fixed strings of Ok, Cancel, Retry, Yes and No. And what do you think? Shouldn't codejock be also able to recognize those 5 strings? Just makes it easier to code TD stuff when you don't have to remember ID-s for standard buttons.
Will you implement it? The schema to allow that is already there ;)
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Another comment on CreateFromFile:
1. USES_CONVERSION in the beginning is unnecessary there for this method;
2. Regarding method names like there in the method's implementation: IsNodeExists() - this is not a good english ;) Should be one of these:
bool IsNodePresent()
or
bool NodeExists();
or
bool HasNode();
P.S. When all changes for TD support are finished, I wouldn't mind getting the header+ source for testing them ;)
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
ops, i meant IsSectionExists method name there above, actually :)
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
The following methods in files XTPTaskDialog.cpp are not declared in XTPTaskDialog.h: GetPropExchangeString, GetPropExchangeInt, GetPropExchangeIcon, GetPropExchangeFlag. As a result, if I want to derive from class CXTPTaskDialog, I have to re-implement those, which is awkward. Their declaration should added into XTPTaskDialog.h |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
For 11.1.2 we moved all common code to another method.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Excellent! And when is 11.1.2 approximately due?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Soon :)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
Have I missed 11.1.1 or do you mean 11.2.0? |
|
Codejock support
|
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Just installed 11.1.2, and i do not see any method to load TaskDialog from a file! What happenned? Why once again this essential feature wasn't added???!!!
It's just so disappointing...
|
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
11.1.2 was a maintenance release to fix outstanding bugs of 11.1, new features will be added to 11.2 which should be released in July. |
|
Codejock support
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Added better method -
BOOL CreateFromResourceParam(CXTPPropExchangeXMLNode* pPX)
so you can load using 3 lines of code:
CXTPPropExchangeXMLNode px(TRUE, NULL, _T("Dialogs")); px.LoadFromFile(strFilePath); CreateFromResourceParam(&px, 0, 0);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
The implementation that i had to do also had paramater lpszDialog, to specify the dialog ID name. How am i supposed to specify it in those three lines?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Just tried this:
CXTPPropExchangeXMLNode px(TRUE, NULL, _T("Dialogs/Dialog[@Name='Dialog002']"));
px.LoadFromFile(_T("C:\\Dialogs.xml")); td.CreateFromResourceParam(&px, 0, 0); td.DoModal(); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Vitaly
Groupie Joined: 05 November 2004 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
What i needed is implementation of method CreateFromFile, and just before your answer, the following implementation was done that seems to work fine (below). Does it seem correct to you?
BOOL CXTPTaskDialogEx::CreateFromFile(LPCTSTR strFilePath, LPCTSTR lpszDialog) { CXTPPropExchangeXMLNode px(TRUE, NULL, _T("Dialogs")); if (!px.LoadFromFile(strFilePath)) return FALSE; if (!px.OnBeforeExchange()) return FALSE;px.SetCompactMode(TRUE); CString strDialogSection; strDialogSection.Format(_T("Dialog[@Name='%s']"), lpszDialog); if (!px.IsSectionExists(strDialogSection)) return FALSE;CXTPPropExchangeSection pxDialog(px.GetSection(strDialogSection)); if (!pxDialog->OnBeforeExchange()) return FALSE; return CreateFromResourceParam((CXTPPropExchangeXMLNode*)&pxDialog, NULL, 0);} |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
Yes, its right code.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |