Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - 11.0.1 - VistaTaskDialog not Finished!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

11.0.1 - VistaTaskDialog not Finished!

 Post Reply Post Reply
Author
Message
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Topic: 11.0.1 - VistaTaskDialog not Finished!
    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:

 

  1. XML is to be VALID, with specified XML Schema in it
  2. A visual designer MUST exist to allow visually create the XML and then save it as such.

 

Chins up, two more steps, and you will deserve all the appraisals there yet to come for it!

 

Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2007 at 1:13pm
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
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 1:01am
Hi,
 
you can download XML editor for dialog:
 
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 4:57am
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.
 
 
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 5:38am

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.

 

Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 11:20am
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!!!
 
 
 
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 11:26am
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...
 
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 12:09pm
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...
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 1:34pm
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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 3:02pm

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
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 3:26pm
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!
 
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2007 at 12:35am
Hello,
 
ok, thanks, waiting finished schema from you.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2007 at 5:56am
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?

Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2007 at 6:07am
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...
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2007 at 6:24am
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
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2007 at 6:31am

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)

 

Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2007 at 6:48pm

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

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2007 at 12:51am
Hi,
 
ExpandedInformation and Footer have False as default,
include MessageBoxStyle with False as defaul.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2007 at 5:40am
Thank you. I should finish it off very soon now...
 
Regarding your post:
Quote
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
 
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...
 
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 28 April 2007 at 5:18pm

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:

 

  1. Using attribute MessageBoxStyle, which is all-specific to CodeJock’s implementation
  2. As attribute ID and Default for buttons and Command Links you are using a Long Integer instead of a text string like in the original TDPad design.

 

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:

 

  1. <br> vs \n formatting,
  2. Using this new schema in all your TD files (I’d suggest giving them TDX extension, i.e. Task Dialog XML)
  3. The new advanced methods for loading TD resource, including one from an external file (CreateFromFile)

 

And keep up good work!

Cheer’o!

 

Vitaly
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 30 April 2007 at 12:56am
Thanks for help, Vitaly.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 30 April 2007 at 5:45am
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!
 
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 30 April 2007 at 6:25am
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....
 

BOOL CXTPTaskDialogEx::CreateFromFile(LPCTSTR strFilePath, LPCTSTR lpszDialog)

{

USES_CONVERSION;

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;

EnableHyperlinks(GetPropExchangeFlag(&pxDialog, _T("EnableHyperlinks")));

EnableCancellation(GetPropExchangeFlag(&pxDialog, _T("AllowCancel")));

ShowProgressBar(GetPropExchangeFlag(&pxDialog, _T("ProgressBar")), FALSE);

SetWidth(GetPropExchangeInt(&pxDialog, _T("Width")), TRUE);

EnableRelativePosition(GetPropExchangeFlag(&pxDialog, _T("RelativeToWindow")));

EnableRtlLayout(GetPropExchangeFlag(&pxDialog, _T("RTLLayout")));

NoDefaultRadioButton(GetPropExchangeFlag(&pxDialog, _T("NoDefaultRadioButton")));

SetWindowTitle(GetPropExchangeString(&pxDialog, _T("WindowTitle")));

SetMainInstruction(GetPropExchangeString(&pxDialog, _T("MainInstruction")));

SetContent(GetPropExchangeString(&pxDialog, _T("Content")));

SetFooter(GetPropExchangeString(&pxDialog, _T("Footer")));

SetMainIcon(GetPropExchangeIcon(&pxDialog, _T("MainInstruction")));

SetFooterIcon(GetPropExchangeIcon(&pxDialog, _T("Footer")));

CXTPPropExchangeSection pxButtons(pxDialog->GetSection(_T("Buttons")));

CXTPPropExchangeEnumeratorPtr enumButton(pxButtons->GetEnumerator(NULL));

POSITION pos = enumButton->GetPosition(0);

while (pos)

{

CXTPPropExchangeSection secButton(enumButton->GetNext(pos));

CString strSection = ((CXTPPropExchangeXMLNode*)&secButton)->GetSectionName();

int nID = GetPropExchangeInt(&secButton, _T("ID"));

if (strSection.CompareNoCase(_T("Button")) == 0 && (nID != 0))

{

AddButton(GetPropExchangeString(&secButton, NULL), nID);

}

else if (strSection.CompareNoCase(_T("CommandLink")) == 0 && (nID != 0))

{

CString strText = GetPropExchangeString(&secButton, _T("Text"));

CString strExplanation = GetPropExchangeString(&secButton, _T("Explanation"));

if (!strExplanation.IsEmpty()) strText += _T("\n") + strExplanation;

AddButton(strText, nID);

EnableCommandLinks(TRUE, !GetPropExchangeFlag(&pxDialog, _T("NoCommandLinkGlyph")));

}

else if (strSection.CompareNoCase(_T("Ok")) == 0)

{

m_config.dwCommonButtons |= TDCBF_OK_BUTTON;

}

else if (strSection.CompareNoCase(_T("Yes")) == 0)

{

m_config.dwCommonButtons |= TDCBF_YES_BUTTON;

}

else if (strSection.CompareNoCase(_T("No")) == 0)

{

m_config.dwCommonButtons |= TDCBF_NO_BUTTON;

}

else if (strSection.CompareNoCase(_T("Cancel")) == 0)

{

m_config.dwCommonButtons |= TDCBF_CANCEL_BUTTON;

}

else if (strSection.CompareNoCase(_T("Retry")) == 0)

{

m_config.dwCommonButtons |= TDCBF_RETRY_BUTTON;

}

else if (strSection.CompareNoCase(_T("Close")) == 0)

{

m_config.dwCommonButtons |= TDCBF_CLOSE_BUTTON;

}

}

SetDefaultButton(GetPropExchangeInt(&pxButtons, _T("Default")));

 

CXTPPropExchangeSection pxRadioButtons(pxDialog->GetSection(_T("RadioButtons")));

CXTPPropExchangeEnumeratorPtr enumRadioButton(pxRadioButtons->GetEnumerator(_T("RadioButton")));

pos = enumRadioButton->GetPosition(0);

while (pos)

{

CXTPPropExchangeSection secButton(enumRadioButton->GetNext(pos));

int nID = GetPropExchangeInt(&secButton, _T("ID"));

if (nID != 0)

{

AddRadioButton(GetPropExchangeString(&secButton, NULL), nID);

}

}

SetDefaultRadioButton(GetPropExchangeInt(&pxRadioButtons, _T("Default")));

if (((CXTPPropExchangeXMLNode*)&pxDialog)->IsSectionExists(_T("ExpandedInformation")))

{

CXTPPropExchangeSection pxExpandedInformation(pxDialog->GetSection(_T("ExpandedInformation")));

SetExpandedInformation(GetPropExchangeString(&pxExpandedInformation, NULL));

ExpandFooterArea(GetPropExchangeFlag(&pxExpandedInformation, _T("Footer")));

ExpandedByDefault(GetPropExchangeFlag(&pxExpandedInformation, _T("Expanded")));

SetExpandedControlText(GetPropExchangeString(&pxDialog, _T("ExpandedText")));

SetCollapsedControlText(GetPropExchangeString(&pxDialog, _T("CollapsedText")));

}

if (((CXTPPropExchangeXMLNode*)&pxDialog)->IsSectionExists(_T("Verification")))

{

CXTPPropExchangeSection pxVerification(pxDialog->GetSection(_T("Verification")));

SetVerificationText(GetPropExchangeString(&pxVerification, NULL));

SetVerifyCheckState(GetPropExchangeFlag(&pxVerification, _T("Checked")));

}

return TRUE;

}

 
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2007 at 10:33am
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" :)))
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2007 at 2:50pm
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
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2007 at 7:04am
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 ;)
 
 
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2007 at 7:21am
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 ;)
 
 
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2007 at 7:24am
ops, i meant IsSectionExists method name there above, actually :)
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 17 May 2007 at 6:13am

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

 

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 17 May 2007 at 8:34am
Hi,
 
For 11.1.2 we moved all common code to another method.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 17 May 2007 at 9:26am
Excellent! And when is 11.1.2 approximately due?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2007 at 5:26am
Soon :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2007 at 8:40am
Originally posted by oleg oleg wrote:

For 11.1.2 we moved all common code to another method.


Have I missed 11.1.1 or do you mean 11.2.0?

Codejock support
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2007 at 1:11pm
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...
 
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2007 at 1:51pm
Originally posted by Vitaly Vitaly wrote:

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???!!!


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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2007 at 3:08pm
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
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2007 at 10:50am
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?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2007 at 11:50am
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
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2007 at 11:59am
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);

}

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2007 at 3:57am
Hello,
 
Yes, its right code.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.