Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Don't annoy me again!

<< < (2/4) > >>

oBFusCATed:
2. What is the purpose of this param then? Doxy comment please.
   Static here is inappropriate, you want external linkage here.
   If I were you, I'd made it enum in the AnnoyingDialog class. So people will have to use something like AnnoyingDialog::SaveChoice
4. Probably add AnnoyingDialogChoice::Unknown
6. People will do this and they will get annoyed, you have to think of a way to handle this (Me included).

Alpha:

--- Quote from: oBFusCATed on May 08, 2013, 11:05:09 pm ---2. What is the purpose of this param then? Doxy comment please.

--- End quote ---
No documentation available yet; here is the constructor's signature:

--- Code: ---        AnnoyingDialog(const wxString& caption, const wxString& message, const wxArtID icon = wxART_INFORMATION,
                       dStyle style = YES_NO, int defaultReturn = wxID_YES, bool separate = true,
                       const wxString& b1 = wxEmptyString, const wxString& b2 = wxEmptyString, const wxString& b3 = wxEmptyString);

--- End code ---


--- Quote from: oBFusCATed on May 08, 2013, 11:05:09 pm ---   Static here is inappropriate, you want external linkage here.

--- End quote ---
Hmm... looks like I have some reading to do.  (My C++ knowledge appears to be rather incomplete.)


--- Quote from: oBFusCATed on May 08, 2013, 11:05:09 pm ---   If I were you, I'd made it enum in the AnnoyingDialog class. So people will have to use something like AnnoyingDialog::SaveChoice
4. Probably add AnnoyingDialogChoice::Unknown

--- End quote ---
My preference would be to switch int defaultReturn = wxID_YES to an enum (for example: dReturnType defaultReturn = YES).  However, I had been attempting to leave the API unchanged (so plugins would not need fixing).


--- Quote from: oBFusCATed on May 08, 2013, 11:05:09 pm ---6. People will do this and they will get annoyed, you have to think of a way to handle this (Me included).

--- End quote ---
This can be solved by reading from both the old and a new settings path, but only writing to the new path.

oBFusCATed:

--- Quote from: Alpha on May 09, 2013, 03:20:27 am ---My preference would be to switch int defaultReturn = wxID_YES to an enum (for example: dReturnType defaultReturn = YES).  However, I had been attempting to leave the API unchanged (so plugins would not need fixing).

--- End quote ---
I have no problem with this. Probably you have to make sure that passing wxID_YES causes a compile error.
So, incorrect usage can be detected and fixed.


--- Quote from: Alpha on May 09, 2013, 03:20:27 am ---This can be solved by reading from both the old and a new settings path, but only writing to the new path.

--- End quote ---
This is an option, yes.

Alpha:
Attached are the changes I am thinking.  (Patch not yet functional, as I have not fixed any uses of AnnoyingDialog; I will probably get to that tomorrow.)

thomas:
Of course a good alternative would be to remove half of the annoying dialogs altogether :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version