Use the NiftyModeEffects dialog box, niftymodeeffects

Source: Internet
Author: User

Use the NiftyModeEffects dialog box, niftymodeeffects


Recently I saw an article about the personalized dialog box, which introduced the cool animation effect. It is easy to use to download open-source projects.

NoftyDialogEffects effect reference:
Http://tympanus.net/Development/ModalWindowEffects/
For more information about how to use it, see the demo. I integrate the NiftyDialogEffects and NiftyNotification. You can download the files you need.

: Http://pan.baidu.com/s/1mgqSfXY


How to Use variables in another dialog box

If the variable is not in the class, define extern CString m_path in cpp of another dialog box, and then you can access it!

If the variable is in the class, set Dialog Box A and Dialog Box B.
CString m_path is in the Class.

First, add A parameter passing function in A class, such as PassParam (LPVOID lpParam), and then add A public variable in Class B, such as CString m_path_in_A ).

Then, call the dialog box in Dialog Box B and access m_path in Class A in B.
Void B: onopenmegawa ()
{
A dlgA;
A. PassParam (this );
A. DoModal ();
// Then m_path_in_A in Class B is the content of m_path in Class B, and you can access it!
}

For PassParam (LPVOID lpParam) in Class ):
Void PassParam (LPVOID lpParam)
{
B * dlgB = lpParam;
DlgB-> m_path_in_A = m_path;
}

Setting the variable to public is not acceptable. I will give you a detailed explanation!
If m_path is in Class A, you must:
A xxx; // xxx is the variable name.
Then A. yyy; // yyy is A member of Class.
This seems acceptable, but in the first case, A xxx; defines variables. After this sentence is executed, the content in xxx is the content after the class A constructor, it definitely does not contain the actual m_path value you want! In this case, only the pointer A * xxx = yyy; is used! However, when class B transmits parameters to Class A, if you use the new operator, it is equivalent to A xxx and you will not get the expected result, only this can be passed! Make sure this! If the passing of this parameter function does not cause variable redefinition, it cannot be in the class. Therefore, the passing of this parameter function must be a friend function!

See it!

Use MFC to implement the Modal Dialog Box

1: Create a button with the ID of IDC_CREATE_DIALOG by clicking "Add button on the main interface and" IDC_CREATE_DIALOG "to create a modal dialog box, it is not a button named "IDC_CREATE_DIALOG.
2: Right-click a resource and choose insert from the shortcut menu to insert a resource. A dialog box for resource insertion is displayed. Add a resource in the dialog box and modify its ID.
3: double-click the resource in the newly added dialog box to add a class. Select CDiglog as the base class.
4: double-click the button to add code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.