|
This Add-In is awesome, thanks.
I was having a bit of trouble loading my license file so I added a catch block as below:
[Editor(typeof(CustomFileNameEditor), typeof(UITypeEditor))]
[Description("License file to display."), Category("Behavior")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string LicenseFile
{
get { return licenseFile; }
set
{
if (licenseFile != value)
{
if(string.IsNullOrEmpty(value))
{
rtbLicense.Text = "Please select the licence file.";
licenseFile = value;
}
else
{
try
{
rtbLicense.LoadFile(value);
licenseFile = value;
}
catch(Exception ex)
{
rtbLicense.Text = "Error: You do not have a license to use this software: " +
ex.Message;
licenseFile = null;
}
}
}
}
}
|
|
|
|
|
We've used your simple wizard control to create an installer for our product. We like it very much! Unfortunately, our intellectual property attorneys can't accept the Code Project Open License. I'm terribly sorry that we didn't consult with the IP attorneys before we implemented, but we didn't.
I'm not an intellectual property attorney and I'm not qualified to dispute their dislike of the CPOL license.
I'm trying to find a way to let us redistribute WizardBase.dll under a license which is acceptable to our IP attorney. Would you consider changing to a BSD license for this code, either at the project level, or as a special "one off" so I could use your code in a commercial product?
Thanks,
Mark Waite
MarkWaite at yahoo dot com
|
|
|
|
|
Geeze, the CPOL is about as un-restrictive as you can get. What specifically does your IP attorney have a problem with? You may also want to bring this up with Chris in the Suggestions/Site Bugs forum.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I've learned not to argue with attorneys, especially when I'm trying to move other things very quickly. I'm not an attorney, and I am new to the company because the previous company was purchased by the new company.
The attorney specifically objected to the phrases which I marked in bold text:
You may distribute the Executable Files and Source Code only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy of the Executable Files or Source Code You distribute and ensure that anyone receiving such Executable Files and Source Code agrees that the terms of this License apply to such Executable Files and/or Source Code. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute the Executable Files or Source Code with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License
Apparently those restrictions apply to the executable as well as the source, where they are more typically applied only to the source code in other open source licenses and that was the "sticking point" for the attorney. I don't claim to understand the legal conditions and terms of the various licenses. The CodeProject license comparison page makes it seem like the CPOL is a better license, yet the attorney preferred the BSD license above it.
There is an interesting posting from 2006 by Jon Galloway which concludes that the CPOL license is more restrictive than most open source licenses. It may be that is an earlier version than CPOL 1.02. I'm not sure.
I am sure that I need the attorneys on my side if I want to release software, and I want to release software...
I'll consider bringing the discussion to the Site Bugs forum.
Thanks
Mark Waite
|
|
|
|
|
I'm using VS2008/.Net 3.5:
I didn't like the way the binding image was stretched to fill the graphic panel, so I made the following modifications:
In StartStep.cs , replace the original OnPaint() method with the code below:
protected override void OnPaint(PaintEventArgs e)
{
Rectangle rect;
Rectangle iconRect;
RectangleF titleRect;
RectangleF subtitleRect;
base.OnPaint(e);
Graphics graphics = e.Graphics;
rect = LeftRectangle;
GetTextBounds(out titleRect, out subtitleRect);
Rectangle gradientRect = new Rectangle(rect.Location, rect.Size);
Rectangle bindingRect = new Rectangle(0, 0, 0, 0);
if (bindingImage != null)
{
bindingRect.Size = new Size(bindingImage.Size.Width, bindingImage.Size.Height);
if (bindingRect.Width != rect.Width)
{
float pct = (float)rect.Width / (float)bindingRect.Width;
bindingRect.Size = new Size(rect.Width, (int)(bindingRect.Height * pct));
}
gradientRect.Location = new Point(gradientRect.X, gradientRect.Y + bindingRect.Height - 1);
gradientRect.Size = new Size(gradientRect.Width, gradientRect.Height - bindingRect.Height);
}
using (Brush brush = new LinearGradientBrush(gradientRect, leftPair.BackColor1, leftPair.BackColor2, leftPair.Gradient))
{
graphics.FillRectangle(brush, gradientRect);
}
if (bindingImage != null)
{
graphics.DrawImage(bindingImage, bindingRect);
}
if (iconImage != null)
{
iconRect = IconRectangle;
iconRect.Inflate(-1, -1);
graphics.DrawImage(iconImage, iconRect);
}
DrawText(graphics, titleRect, title, titleAppearence);
DrawText(graphics, subtitleRect, subtitle, subtitleAppearence);
}
In IntermediateStep.cs , LicenseStep.cs , and FinalStep.cs , replace the original OnPaint() with this one:
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics graphics = e.Graphics;
Rectangle rect = HeaderRectangle;
Rectangle rectangle;
RectangleF titleRect;
RectangleF subtitleRect;
Rectangle gradientRect = new Rectangle(rect.Location, rect.Size);
Rectangle bindingRect = new Rectangle(0, 0, 0, 0);
GetTextBounds(out titleRect, out subtitleRect);
if (bindingImage != null)
{
bindingRect.Size = new Size(bindingImage.Size.Width, bindingImage.Size.Height);
if (bindingRect.Height != rect.Height)
{
float pct = (float)rect.Height / (float)bindingRect.Height;
bindingRect.Size = new Size((int)((float)bindingRect.Width * pct), rect.Height);
bindingRect.Location = new Point(gradientRect.Width - bindingRect.Width, 0);
}
gradientRect.Location = new Point(gradientRect.X, gradientRect.Y);
gradientRect.Size = new Size(gradientRect.Width - bindingRect.Width, gradientRect.Height);
}
headerPair = new ColorPair(Color.White, Color.DarkSlateBlue, 180);
using (Brush brush = new LinearGradientBrush(gradientRect, headerPair.BackColor1, headerPair.BackColor2, headerPair.Gradient))
{
graphics.FillRectangle(brush, gradientRect);
}
if (bindingImage != null)
{
graphics.DrawImage(bindingImage, bindingRect);
}
titleAppearence.TextShadowColor = Color.Transparent;
titleAppearence.TextColor = Color.White;
subtitleAppearence.TextColor = Color.White;
subtitleAppearence.TextShadowColor = Color.Transparent;
DrawText(graphics, titleRect, title, titleAppearence);
DrawText(graphics, subtitleRect, subtitle, subtitleAppearence);
}
The code above resizes the bindingImage to fit inside the graphic panel, while maintaining the original aspect ratio of the image. It further changes the gradient rectangle so that it ends where the bindingImage starts, thus providing a reasonable transition from the gradient to the image. Of course, this only really looks good if the bindingImage has a single-color background, but you can also just set the gradient colors to be the same (essentially eliminating the gradient).
Other things I had to do:
0) I had to comment out all the pragma s because I kept getting compile errors.
1) I had to comment out the set functionality in the LeftPair property because I kept getting the serialization n compiler error.
2) I had to hard-code my gradient colors because the designer refused to keep the settings I made.
3) When I tried to set the bindingImage for the intermediate step page, I was getting an error from the IDE saying the setting already existed. All I did was click on it - I never got to the point where I could change the setting.
4) When I try to add a handler for normal form events, the method templates aren't being added to the application - anywhere.
IMHO, this could would be better if there were templates created to create the form and it's child pages. I think that would simplify the code and enable us to better isolate deficiencies.
I also think you would have been better served to create a StepBase class and put all the common stuff in it, such as the graphic panel, the binding image, and the gradient color pair stuff, just to name a few of the items.
Personal note to the author:
You seemed to have put a lot of work into the code, but you stopped far short of coming up with something viable. There is absolutely no reason for me to have to hard-code stuff into the control itself to make changes, especially with the effort you put into making the control compatible with the IDE designer. Further, you seem to have abandoned the code, forcing your users to try to figure out what the hell your code does. There is no documentation, and pitifully few comments, thus making the code a royal bitch to maintain. It now falls on someone else to take your c ode and recreate it in their own image, and hopefully post a new article with code that actually works.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
if you want to provide a grafical design then provide it as a template, as I am finding it a pain to remove the default gradient etc...
if you be nice to start with a blank slate
|
|
|
|
|
I ended up hard coding the gradient I wanted. The code in this article is only half done.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I was just saying it would be nice to have a blank canvas to start from and not have to remove someone else's design first, if the author wants to include some designs then it should be included as a template that can be selected on the properties window
|
|
|
|
|
The author has abandoned the article. You'll get no satisfaction from him. I stand by my claim that the code is only half done.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
you are right, it is very buggy and awkward to use at times.
but I have not been able find a free replacement that will work under 3.5 as of yet
|
|
|
|
|
Well, I've started a complete rewrite. It's gonna take a while because I've never done a designer-integrated control before. IMHO, that's where most of the problems lie in the existing code, so designer integration may have to wait or even be abandoned because backward compatibility will be an issue, not to mention forward compatibility.
I'm leaning toward the control-as-a-template idea, and am designing the base classes that provide the basic/common functionality. When the programmer creates a control from the template, he'll be able to make normal changes n the designer, but special settings may be restricted to being manually added - I simply don't know yet.
Anyway, I'll post an article when it's ready.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Help why do I get this error??????
"No overload for 'wizardControl1_NextButtonClick' matches delegate 'WizardBase.GenericCancelEventHandler<WizardBase.WizardControl>"
on this line of code
<code>this.wizardControl1.NextButtonClick += new WizardBase.GenericCancelEventHandler<WizardBase.WizardControl>(this.wizardControl1_NextButtonClick);</code>
|
|
|
|
|
I HAVE THA SAME ERROR. Can some one help?
|
|
|
|
|
help me please... same error occurs..
|
|
|
|
|
reply reference.(2page)
thanks!
================================================================
Re: NextButtonClick Event [modified] MadStudent 7:21 29 Feb '08
================================================================
|
|
|
|
|
No answer to this question until now? I have the same error. Please help.
|
|
|
|
|
try this:
private void wizardControl1_NextButtonClick(object sender, GenericCancelEventArgs<WizardBase.WizardControl> tArgs)
Regards,
Lenny
|
|
|
|
|
do this
private void wizardControl1_NextButtonClick(object sender, EventArgs e)
|
|
|
|
|
You've provided absolutely no explanatory text, there's almost no comments in the code, and that 2nd comment is exasperated by the fact that you're not responding to questions/bug reports.
|
|
|
|
|
Hello,
It's a nice control but why is not it possible to design step at design time? They look different at runtime and design time.
To be more precise, I need to click 'next step' from the smart tag to design next step, selecting instance of WizardBase.IntermidiateStep from dropdown box of properties window doesn't change to next step in designer.
|
|
|
|
|
When i click in the next button i get this error:
Message="The step must be well formed, so there cannot be a Finishstep without a Startstep."
Source="WizardBase"
any idea?
|
|
|
|
|
I had the same problem. I had to comment out some code to make it work again. Set a breakpoint on the error and comment out the code that causes the error. It's some kind of check but leaving it out doesn't hurt the functionality.
|
|
|
|
|
I am trying to direct the wizard to optional pages depending on whether or not a checkbox is checked on page 1 (index 0).
private void wizardControl1_NextButtonClick(object sender, WizardBase.GenericCancelEventArgs<WizardBase.WizardControl> tArgs)
{
if (checkBox1.Checked != true)
{
wizardControl1.CurrentStepIndex=2;
}
}
If the checkbox is checked, pressing the Next button moves to the next page as expected, however, if the checkbox is unchecked, the above code runs. I assume that setting the CurrentStepIndex - 2 should move focus to the third page - and there is a third - but instead of that, I get the following error...
Error Message: The step must be well formed, so there cannot be a Finishstep without a Startstep.uasi
|
|
|
|
|
I'm having the same problem, but nobody seems to care
|
|
|
|
|
Hi,
we added shortcuts and tootips to the wizard. It seems to work fine intially. Later on, i found that there is an issue.
Usually, the tooltip does not show up on the first step, when i go to the 2nd or 3rd step. It start working ; and once it start working, it works even on the first step.
The shortcut also work strangely, some time it works and sometime it does not. It may work on one step and would not work on the other step.
Are you aware of these issues ? what am i suppose to do. My project is almost finish and i need these features i.e. shortcuts and tooltips for sure. Please provide me with an update or something. Thanks,
Regards,
Osman
|
|
|
|
|