À©µµ¿ì ÇÁ·Î±×·¡¹Ö ÀÚ·á

HomePage Backward Forward Post Reply List
Delete Modify
  Á¦¸ñ   [MFC] Property Sheet 1998/08/02 (16:44)
À̸§ swindler
¹øÈ£ 52
Á¶È¸ 446
º»¹® ¼Ó¼º½ÃÆ®(Property Sheet)

1. µ¿ÀÏÇÑ Å©±âÀÇ ´ÙÀ̾ó·Î±× ÅÛÇø´µéÀ» ¸¸µç´Ù. ĸ¼ÇÀº
ÅÇ»ó¿¡ Ãâ·ÂµÉ ¹®ÀÚ¿­ÀÌ µÈ´Ù.

2. ClassWizard·Î °¢ ÅÛÇø´À» À§ÇÑ Å¬·¡½º¸¦ ¸¸µç´Ù.
±âÃÊŬ·¡½º·Î CPropertyPage¸¦ ¼±ÅÃÇÑ´Ù. ÄÁÆ®·ÑÀ» À§ÇÑ
µ¥ÀÌÅÍ ¸â¹öµéÀ» ÷°¡ÇÑ´Ù.
CPage1 m_page1;
CPage2 m_page2;
CPage3 m_page3;

3. ClassWizard¸¦ ÀÌ¿ëÇÏ¿© CPropertySheet¿¡¼­ ÆÄ»ýµÈ
Ŭ·¡½º¸¦ Çϳª »ý¼ºÇÑ´Ù.

4. ÆäÀÌÁö Ŭ·¡½º °¢°¢¿¡ ´ëÇØ µ¥ÀÌÅÍ ¸â¹ö¸¦ ÆÄ»ýµÈ
CPropertySheet¿¡ Ãß°¡ÇÑ´Ù.

5. ÆÄ»ýµÈ ¼Ó¼º ½ÃÆ® Ŭ·¡½ºÀÇ »ý¼ºÀÚ¿¡¼­ Æ÷ÇÔµÈ ÆäÀÌÁö
°´Ã¼ÀÇ ÁÖ¼Ò¸¦ ÁöÁ¤ÇÏ¿© °¢ ÆäÀÌÁö¿¡ ´ëÇØ AddPage()¸â¹ö
ÇÔ¼ö¸¦ È£ÃâÇÑ´Ù.
AddPage(&m_page1);
AddPage(&m_page2);

6. ¾îÇø®ÄÉÀ̼ǿ¡¼­´Â CPropertySheet¿¡¼­ ÆÄ»ýµÈ Ŭ·¡½ºÀÇ
°´Ã¼¸¦ »ý¼ºÇÑ ´ÙÀ½, DoModal()À» È£ÃâÇÑ´Ù. »ý¼ºÀÚ È£Ãâ½Ã¿¡
ĸ¼ÇÀ» ÁöÁ¤Çصµ µÇÁö¸¸, ³ªÁß¿¡ CPropertySheet::SetTitle()
¸¦ È£ÃâÇÏ¿© ĸ¼ÇÀ» º¯°æÇÒ ¼öµµ ÀÖ´Ù.
CTestSheet m_sh;
m_sh.SetTitle("Default Format");
m_sh.DoModal();

7. Apply ¹öÆ°ÀÇ Äڵ带 ÀÛ¼ºÇÑ´Ù.


¼Ó¼º½ÃÆ® µ¥ÀÌÅÍ ±³È¯
ÇÁ·¹ÀÓ ¿öÅ©´Â »ç¿ëÀÚ°¡ ¼Ó¼º ÆäÀÌÁö¸¦ ÀüȯÇÒ ¶§¸¶´Ù ÇØ´ç
¼Ó¼º ÆäÀÌÁöÀÇ DDX(Dialog Data Exchange) Äڵ带 È£ÃâÇÑ´Ù.
¶ÇÇÑ »ç¿ëÀÚ°¡ OK¹öÆ°À» Ŭ¸¯ÇÒ ¶§µµ ÆäÀÌÁöÀÇ DDXÄڵ带
È£ÃâÇÏ¿© ÆäÀÌÁöÀÇ µ¥ÀÌÅÍ ¸â¹ö¸¦ °»½ÅÇÑ´Ù.

ÇÑ ÆäÀÌÁöÀÇ ³»¿ëÀ» º¯°æÇÑ ´ÙÀ½¿¡ ´Ù¸¥ ÆäÀÌÁö·Î À̵¿ÇÑ ´ÙÀ½
Cancel¹öÆ°À» Ŭ¸¯Çϸé ÀÌÀü ÆäÀÌÁö¿¡¼­ º¯°æµÈ ³»¿ëÀº Àû¿ëµÈ´Ù.

Apply¹öÆ°Àº Á÷Á¢ Äڵ带 ÀÛ¼ºÇÏÁö ¾ÊÀ¸¸é ¾Æ¹« Àϵµ ÇÏÁö
¾Ê°í ¹öÆ°µµ ºÒ°¡´É »óÅ·Π³ªÅ¸³­´Ù. Apply¹öÆ°À» °¡´ÉÇÑ »óÅ·Î
¸¸µé·Á¸é °¡»óÇÔ¼ö CPropertyPage::OnApply()¸¦ ¿À¹ö¶óÀ̵åÇÏ¿©
ÆäÀÌÁö Ŭ·¡½º¿¡¼­ Apply ¹öÆ°¿¡ ´ëÇÑ Çڵ鷯 ÇÔ¼ö¸¦ ÀÛ¼ºÇؾß
Çϸç, ¹öÆ°ÀÌ »ç¿ë°¡´ÉÇØÁ³´Ù¸é »ç¿ëÀÚ°¡ ÆäÀÌÁö ³»¿ëÀ» º¯°æÇÒ¶§
SetModified(TRUE)¸¦ È£ÃâÇÏ¿© ÆäÀÌÁöÀÇ º¯°æ Ç÷¡±×¸¦
¼³Á¤ÇØ¾ß ÇÑ´Ù. OnApply()´Â ÇϳªÀÇ ÆäÀÌÁö Ŭ·¡½º¿¡¼­¸¸
¿À¹ö¶óÀ̵åÇÏ¸é µÈ´Ù.

OnApply() ÇÔ¼öÀÇ ÄÚµå ³»¿ëÀº ÇÁ·Î±×·¡¸Ó°¡ ÇØ¾ß ÇÒ ÀÏÀÌÁö¸¸
ÇÑ °¡Áö ¼±ÅÃÀ¸·Î ¼Ó¼º ½ÃÆ®·Î ¸¸µç °´Ã¼¿¡ »ç¿ëÀÚ Á¤ÀÇ ¸Þ½ÃÁö¸¦
º¸³»´Â ¹æ¹ýÀÌ ÀÖÀ» ¼ö ÀÖ´Ù. ÀÌ °æ¿ì ¸Þ½ÃÁö Çڵ鷯¿¡¼­´Â ¼Ó¼º
½ÃÅ©°¡ È­¸é¿¡ Ãâ·ÂµÈ »óÅ¿¡¼­ ÆäÀÌÁöÀÇ µ¥ÀÌÅÍ ¸â¹ö¸¦ ¾ò¾î
ó¸®ÇÒ ¼ö ÀÖ°Ô µÈ´Ù.

CPropertyPage::SetModified
void SetModified( BOOL bChanged = TRUE );

Parameters
bChanged TRUE to indicate that the property page settings have been modified since the last time they were applied; FALSE to indicate that the property page settings have been applied, or should be ignored.

Remarks
Call this member function to enable or disable the Apply Now button, based on whether the settings in the property page should be applied to the appropriate external object.

HomePage Backward Forward Post Reply List
1998 by swindler