«á¤@­¶
«e¤@­¶
¦^¥Ø¿ý
¦^­º­¶
²Ä¤@³¹¡@Delphi§Ö³t¤Jªù¡]¤G¡^

1.2.3 ³]­p²³æªº¥Î¤á¤¶­±¡@

          ­º¥ý±qªÅ¥Õµ¡Åé¶}©l¤u§@¡C§Ú­Ì±N³]­p¤@­Ó²³æªºµ{¦¡:¦b¿Ã¹õ¤W¶}¤@­Óµøµ¡¡Aµøµ¡¤¤¦³¤@­Ó¹Ï®Ø¡A¥Î¤T­Ó«ö¶s¨Ó§ïÅܹϮتº§Îª¬¡F¦A¥Î¤@­Ó¹Ï¥Ü«ö¶s¨Ó¶i¦æ¹Ï®ØªºÃC¦â³]©w¡A³q¹LÃC¦â½s¿è¹ï¸Ü¤è¶ô¨Ó¿ï¾ÜÅܦ¨­þ¤@ºØÃC¦â¡C

          ¦b¿ï¾Üªí¤W¿ï¥ÎFile|New Application¿ï¾Üªí¶µ¨Ó²£¥Í·sªº¤uµ{¤å¥ó¡C³o®É¡A¿Ã¹õ¤W¥X²{¹Ï1.2©Ò¥Üªºµ¡Åé¡C¡@

1.2.3.1 ¿ï¨ú³¡¥ó¥[¤J¨ìµ¡Å餤¡@

            ³¡¥ó(Component)¬O«Ø¥ßDelphiÀ³¥Îµ{¦¡ªº­n¯À¡CDelphi¬°¥Î¤á´£¨Ñ¤FÂ×´Iªº³¡¥ó®w¡A¬J¦³¥iµøªº³¡¥ó(¦p½s¿è®Ø¡B«ö¶s)µ¥¡A¤]¦³¤£¥iµøªº³¡¥ó(¦p¨t²Î©w®É¾¹¡B¼Æ¾Úªíµ¥)¡C¥¦­Ì«ö·Ó¥\¯à¤À§O±Æ¦C¦bComponent Panelªº¦U­¶¤W¡C

            ²¾°Ê·Æ¹«¨ìComponent Panel¤W¡A¦b³¡¥ó«ö¶s¤W¡§µS¿Ý¡¨¤@¡B¨â¬íÄÁ¡A¤@­Ó¶À¦â¤p´£¥Ü®Ø´N·|¼u¥X¡A¼g¦³¸Ó³¡¥óªº¼Ðñ¡A§Ú­ÌºÙ¤§¬°´£¥Ü(Hint)¡C¦b­n¿ï¾Üªº³¡¥ó¤W«ö¤@¤U¥ªÁä¡A«h¸Ó³¡¥ó«ö¶s³Q«ö¤U¡Aªí¥Ü³¡¥ó¤w³Q¥Ø«e¿ï¾Ü¡CµM«á¡A±N·Æ¹«²¾°Ê¨ìµ¡Åé¤W¡A«ö¤U¥ªÁä¡A¸Ó³¡¥ó³Q©ñ¨ìµ¡Å餤¡C³¡¥óªº½ü¹ø½u¤W·|Åã²{¤K­Ó³QºÙ¬°¤Ø¤o½Õ¾ã¾¹(Sizing Handles)ªº¶Â¦â¤p¤è¶ô¡C¥¦°£¤F¨Ñ¥Î¤á½Õ¾ã¤Ø¤o¨Ï¥Î¤§¥~¡AÁÙ¥i¥Hªí¥Ü¸Óª«¥ó³B©ó¥Ø«e½s¿èª¬ºA¡C¦¹®É¡A«ö¡§Delete¡¨Áä¥i¥H±N¸Ó³¡¥ó¸Ñ°£¡C

            ¦bComponent Panel¤W¡AÂI°Ê¼g¦³¡§Additional¡¨ªº­¶¼ÐÅÒ¡A¤Á´«¨ìAdditional­¶¡A¦A²¾°Ê·Æ¹«¡A³v­Ó¥ÎÆ[¬ÝHintªº¿ìªk¬d¬Ý³¡¥óªº¼Ðñ¡A§ä¨ì¡§Shape¡¨³¡¥ó(¨ä¹Ï¥Ü¬°¶ê¡B¤è§Î¡B¤T¨¤§Î¤T­Ó´X¦óÅé)¡A±N¨ä©ñ¨ìµ¡Å骺¥ª¤è¡C

            ¦A«ö°Ê¡§Standard¡¨­¶¼ÐÅÒ¡A§ä¨ì¡§Button¡¨³¡¥ó(¹Ï¥Ü¤Wµe¦³OK«ö¶s)¡CDelphi¤¹³\¦b¥[¤J¦h­Ó¦P«¬¦¡ªº³¡¥ó®É¡A¤£¥²¨C¦¸¨ì³¡¥ó¿ï¶µªO¤W¿ï¨ú¡C«ö¦í¡§Shift¡¨Áä¡A¦P®É¦b¡§Button¡¨³¡¥ó¤W«ö¤@¤U·Æ¹«¥ªÁä¡A³o®É¡§Button¡¨³¡¥ó³B©ó«ö¤Uª¬ºA¡A¨Ã¦³ÂŦâÃä®Ø¡Aªí¥Ü¤w¸g³Q¿ï¾Ü©T©w¡C¨Ì¦¸¦bµ¡Åé¥k¤èªº¤T­Ó¦ì¸m«ö¤@¤U¥ªÁä¡A«h·|©ñ¸m¤T­Ó¬Û¦PªºButton³¡¥ó¡C§â·Æ¹«¹C¼Ð²¾¨ì³¡¥ó¿ï¶µªO¥ª°¼ªº½bÀY¹Ï¥Ü³B¡A³o¬O¡§¨ú®ø¿ï¾Ü¡¨«ö¶s¡A¥¦¨S¦³´£¥Ü¡C«ö°Ê¥¦¡A·|µo²{¡§Button¡¨³¡¥ó«ö¶s«ì´_¼u°_ª¬ºA¡C§_«h¡A¨C¦¸¡§Form1¡¨¤Wªº·Æ¹««ö¤@¤U¥ªÁä°Ê§@¡A³£·|¾É­P¼W¥[¤@­Ó«ö¶s³¡¥ó¡C

            ¦A¦¸¶i¤J¡§Additional¡¨³¡¥ó­¶¡A¿ï¾Ü¤@­Ó¡§BitBtn¡¨«ö¶s(¹Ï¥Ü¬O¦³ºñ¦â¹ï¸¹ªºOK«ö¶s),§â¥¦©ñ¨ì¨ä¥¦¤T­Ó«ö¶s³¡¥óªº¤U­±¡C

            ÂI°Ê¡§Dialog¡¨­¶¼ÐÅÒ¡A¿ï¾Ü¥H16¦âºô®æ°µ¹Ï¥ÜªºColorDialog³¡¥ó¨Ã§â¥¦©ñ¨ìµ¡Å骺¥ô·N¦ì¸m¡C¦]¬°³o¤@³¡¥ó¬O¤£¥iµø³¡¥ó¡A©Ò¥H¥¦ªº¦ì¸m¨Ã¤£¼vÅT¤j§½¡C¡@

1.2.3.2 ³¡¥óªº½Õ¾ã»P¹ï»ô¡@

           ¤@¯ë¨ÓÁ¿¡A¦¹®É©ñ¸m¨ìµ¡Å骺³¡¥ó¬O¤À´²±Æ¦Cªº¡A¦Ó¥B¨ä¤j¤p¤£¬O¯u¥¿»Ý­nªº¤Ø¤o¡C°£¤F¤£¥iµøªºColorDialog³¡¥ó¥~¡A¨ä¥¦ªº³¡¥ó³£»Ý­n¶i¦æ¦ì¸m¡B¤j¤p©MÅã¥Ü¦r¼Ëªº½Õ¾ã¡CDelphi´£¨Ñªº¹ï»ô¤u¨ã©Mµøµ¡¬]®æ¬°³o¨Ç½Õ¾ã´£¨Ñ¤F¤è«K¡C

1¡B²¾°Ê³¡¥ó

           ¥u»Ý§â·Æ¹«¸¨¨ì·Q²¾°Êªº³¡¥ó¤W¡A«ö¦í¥ªÁä¨Ã²¾°Ê¹C¼Ð¡A¨ì¦X¾Aªº¦ì¸m¦AÄÀ©ñ¥ªÁä¡A¾ã­Ó³¡¥ó§Y³Q²¾¨ì·s¦ì¸m¡C

2¡B½Õ¾ã¤Ø¤o

            ¥ý§â·Æ¹«¹C¼Ð²¾°Ê¨ì­n§ïÅܤؤoªº³¡¥ó¤W¡A«ö¤@¤U¥ªÁä¡A¿ï¤¤¸Ó³¡¥ó¡A¤Ø¤o½Õ¾ã¾¹·|¥X²{¡A§â·Æ¹«²¾°Ê¨ì¨ä¤¤ªº¤@­Ó¤p¶Â¦â¤è¶ô¤W¡A·í·Æ¹«Åܦ¨©ì°Ê¤è¦V«ü¥Ü®É¡A«ö¤U¨Ã©ì°Ê·Æ¹«¥ªÁä¡A¥i¥H©ñ¤j©ÎÁY¤p³¡¥ó¡C¤W¤U¥ª¥kªº¤p¤è¶ô¥Î¨Ó²¾°Ê¹ïÀ³ªº¦UÃä¡A¥|­Ó¨¤ªº¤è¶ô¥i¥H²¾°Ê¬Û³sªº¨â±øÃä¡C¦pªG­nºë½T¦aªí­z³¡¥óªº¤Ø¤o¡A¥i¥H¦bObject Inspector¤W¡A§ïÅÜLeft(ªí¥Ü³¡¥ó¥ªÃä½t¨ìµ¡Å饪Ãä®Øªº¹³¯ÀÂI¼Æ)¡BTop(ªí¥Üµ¡Åé¤WÃä®Ø¨ì³¡¥ó¤WÃä½tªº¹³¯ÀÂI¼Æ)¡B Width(³¡¥ó¥»¨­ªº¼e«×)¡BHeight(³¡¥ó¥»¨­ªº°ª«×)µ¥ÄÝ©Ê¡CÃö©ó§ïÅܳ¡¥óªºÄÝ©Ê¡A¤U¤åÁÙ±N¥J²ÓÁ¿¸Ñ¡C

3¡B¨Ï±o¤@¸s¸s²Õ³¡¥ó¹ï»ô

             ¥Î½Õ¾ã¦ì¸mªº¤èªk¥i¥H¹ï»ô³¡¥ó¡A¦ý¾Þ§@¨BÆJ½ÆÂø¡CDelphi´£¨Ñªº¹ï»ô¤u¨ã¥i¥H¨Ï¦h­Ó³¡¥óªº¹ï»ô·¥¬°¨³³t¤è«K¡C¤U­±§Ú­Ì¨Ó¨Ï¥|­Ó«ö¶s¹ï»ô¡C¥ý±N¥|­Ó«ö¶s¿ï¬°¤@¸s¸s²Õ¡G«ö¦í¨Ã¦V¥k¤U¤è©ì°Ê·Æ¹«¥ªÁä¡A¦bµ¡Åé¤Wµe¥X³ò¶¥|­Ó«ö¶sªº¯x§Î¡AÄÀ©ñ¥ªÁä«á¡A³Q¿ï¤¤ªº«ö¶s¶gÃä·|¥X²{·t¦Ç¦âªºÃä®Ø¡C¿ï¥ÎEdit|Align©R¥O¡A©Î¨Ï¥Î¼u¥X¦¡¿ï¾Üªí(¦b³Q©T©wªº³¡¥ó¤W«ö¤@¤U·Æ¹«¥kÁä¿E¬¡)¡A¥i¥HÅã¥Ü¹Ï1.4©Ò¥Üªº¹ï¸Ü¤è¶ô¡C

             ­n¨Ï«ö¶sªu¥ªÃä¹ï»ô¨Ã¨Ï¥¦­Ì¦b««ª½¤è¦V¤W§¡¤Ã¤À¥¬¡A¥ý¦bAlignment¹ï¸Ü¤è¶ôªºHorizontalÄ椺¿ï¾Ü¡§Left sides¡¨¡A¦b¡§Vertical¡¨Ä椺¿ï¾Ü¡§Space equally¡¨¡A«ö°ÊOK«ö¶s¡ADelphi´N·|¦Û°Ê±N¥¦­Ì¹ï»ô¡CµM«á¡A±z¥i¥H±N¥¦­Ì¥|­Ó§@¬°¤@¸s¸s²Õ¨Ó²¾°Ê¡C¦b¥|­Ó«ö¶s¥H¥~ªºµ¡Åé¤W«ö°Ê·Æ¹«¥ªÁä¡A´NÄÀ©ñ¤F¸s¸s²Õ¤¤ªº³¡¥ó¡A¨Ï¥¦­Ì¦¨¬°¤À¥ßªº³¡¥ó¡C

             §Q¥Î¹ï»ô¼ÒªO¨Ó¹ï»ô³¡¥ó¤]¬O«Ü¤è«Kªº¡C­º¥ý­n±N­n¹ï»ôªº³¡¥ó¿ï¦¨¤@¸s¸s²Õ¡A¿ï¾ÜView|Alignment PaletteÅã¥Ü¹ï»ô¼ÒªO¡C«ö·Ó©Ò¥Üªº¤è¦¡¿ï¾Ü§Y¥i¹F¨ì¹ï»ôªº¥Øªº

4¡BÂê©w³¡¥ó

             ¦pªG³¡¥ó¤w¸g¹ï»ô¡A¬°¨¾¤î¤£¤p¤ß²¾°Ê³¡¥ó¡A¥i¥H±N³¡¥ó¦ì¸mÂê©w¡C¿ï¾Ü¥D¿ï¾Üªí¤WªºEdit|Lock Controls¿ï¶µ¡A¨Ï±o³¡¥ó¤£¯à¶i¦æ²¾°Ê¾Þ§@¡C¸ÑÂê¥u»Ý¦A¦¸¿ï¾Ü¦¹¶µ§Y¥i¡C

             ½Õ¾ã¡§Shape¡¨³¡¥óªº¤j¤p¡A¨Ï¤§»P¥kÃ䪺«ö¶s¸s¸s²Õ¬Û¤Ç°t¡C¦A§ïÅܵ¡Å骺¤j¤p¡A«ö¦í¨Ã©ì°Êµ¡Åé¥k¤U¤è¨Ï¤§­è¦n¥]®eµ¡Åé¤Wªº¥þ³¡³¡¥ó¡C³o¼Ë¡A±zªº¥Î¤á¤¶­±´N·|¤ñ¸û¬üÆ[¡C¡@

1.2.3.3 ¦sÀÉ©Ò°µªº¤u§@¡@

             ¤Î®É¦a¦sÀÉ©Ò°µªº¤u§@¦ÜÃö­«­n¡C¹ï³]­pªÌ¨ÓÁ¿¡A¦³¨â­Ó¤å¥ó»Ý­n¦sÀÉ¡G®w³æ¤¸¤å¥ó(¥H.PAS¬°«áºó)©M¤uµ{¤å¥ó(¥H.DPR¬°«áºó)¡C

             ±q¥D¿ï¾Üªí¤W¿ï¾ÜFile|Save Project As...¶µ¡ADelphi·|Åã¥Ü¼ÐÃD¬°¡§Save Unit1 As¡¨ªº¤å¥ó¦sÀɹï¸Ü¤è¶ô¡ADelphi 2.0 ¤¹³\¥Î¤á­×§ï¦sÀx¸ô®|¡A±z¥i¥H¦b¤U©Ô¦¡¦C¥Ü¤è¶ô¤¤¿ï¾Ü¡C³Ì¦n±N±zªº¤å¥ó¦sÀɦb¦Û¤vªº¥Ø¿ý¤¤¡C¦b½s¿è®Ø¤¤Áä¤Jdemoform.pas¥H¦sÀÉ®w³æ¤¸¤å¥ó¡FµM«áÅã¥Ü¼ÐÃD¬°¡§Save Project As¡¨ªº¥t¤@­Ó¤å¥ó¦sÀɹï¸Ü¤è¶ô¡AÁä¤Jsample.dpr¡CDelphi¦sÀɳo¨â­Ó¤å¥ó¨Ãªð¦^µ¡Åéµøµ¡¡C¤£­n§â®w³æ¤¸©M¤uµ{¦s¦¨¤@¼ËªºÀÉ®×¼Ðñ¡ADelphi­n¨D¨âªÌ¤£¦P¡C

             ²Ä¤@¦¸¦sÀÉ«á¡A¥H«á¥i¥HÀH®É³q¹LSpeed Bar¤¤ªº¡§Save All¡¨©M¡§Save file¡¨¨Ó¦sÀɤuµ{¤å¥ó©M®w³æ¤¸¤å¥ó¡C¤@¯ë¨ÓÁ¿¡A·í½T»{¤å¥óªº§ïÅÜ«á¡A­n¦P®É¦sÀx³o¨â­Ó¤å¥ó¡C¡@

1.2.3.4 °õ¦æ¤uµ{¡@

            ¥H¤Wªº¾Þ§@¨Ï±z¦³¤F¤@­Ó¦Û¤vªºÀ³¥Îµ{¦¡¤¶­±¡C¦b³t«×±ø¤¤«ö°Ê¡§Run¡¨«ö¶s(ø¦³ºñ¦â¤T¨¤¹Ï¥Ü)¡A±z¥i¥H¬Ý¨ì¡A©Ò²£¥Íªº¤¶­±»P±z³]­pªº¤¶­±¬O§¹¥þ¤@­Pªº¡C¡@

1.2.4 §ïÅܪ«¥óªºÄÝ©Ê

            ¤W­zªº¤uµ{Áö¯à°÷°õ¦æ¡A¦ý¥¦¹ï±zªº«ö°Ê«ö¶s¾Þ§@¬O¨S¦³¤°»ò¤ÏÀ³ªº¡A¦Ó¥B¡A©Ò¦³³¡¥ó¤WÁÙ¼gµÛ§Ú­Ì¤£»Ý­nªº¦r¼Ë¡C³sÄò«ö¨â¤Uµøµ¡ªºÃö³¬«ö¶sµ²§ô°õ¦æ¡A¦^¨ì³]­p¤¶­±¡C¤U­±¡A§Ú­Ì±N¥J²ÓÁ¿­z¦p¦ó¦bObject Inspector¤¤§ïÅܳ¡¥óªº¦UºØÄÝ©Ê¡C¡@

1.2.4.1 ¥ÎProperties­¶§ïÅܳ¡¥óªºÄÝ©Ê­È¡@

             ­º¥ý­n§ïÅܦUºØ³¡¥óªº¼ÐÃD¡C¥ýµ¹µøµ¡©R¦W¬°¡§Demo¡¨¡C«ö°ÊObject Inspector¤WºÝªºObject SelectorªºÃD±ø©ÎªÌ¨ä¥kºÝªº¤U©Ô¼Ð»x¡A§ä¨ìForm1¶µ¡A¨ÃÂI°Ê¥ªÁä¡Aµ¡Åé³Q¿ï¤¤¡C¦bObject InspectorªºProperties­¶¤¤¡A§ä¨ìCaptionÄݩʨåΥªÁä¿ï¤¤¡A±N¨ä¥kºÝªºForm1§ï¬°Demo,¦P®É¡A±z·|µo²{µ¡Å骺¼ÐÃD¤w¸g¬ÛÀ³¦a°µ¤F§ïÅÜ¡C

             ¥Î·Æ¹«ÂI¤¤µ¡Å餤ªºShape³¡¥ó¡AObject Inspector¦C¥X¤F¥¦ªºÄÝ©Ê¡C¿ï¤¤ShapeÄÝ©Ê¡A±z·|µo²{¥kºÝ¥X²{¤F¤U©Ô¼Ð»x¡CÂI°Ê³o¤@¼Ð»x¡A¥i¥H¬d¬Ýª«¥óªºShapeÄÝ©Ê¥i¿ï­È¡C¥¦ªº§Îª¬¥i¥H¬O¯x§Î¡B¶ê§Î¡B¶ê¨¤¯x§Î¡B¤è§Îµ¥´XºØ¡C³o¬O§Ú­Ì³]­p«áÄò¥\¯àªº°ò¦¡C

             ¿ï¤¤Button1«ö¶s¡A¦¹®ÉObject Inspector¤w¸gÅã¥Ü¥X¦¹«ö¶sªº¤@À³ÄÝ©Ê¡C±N¥¦ªºCaptionÄݩʧאּ¡§&Rectangle¡¨,¡§&¡¨¸¹¨Ï±oDelphi¯S®í³B²z¥¦«á­±ªº¦r¤¸¡A¦b³oùØ¡A«ö¶s¤¤ªºR¦r¥À³Q°µ¤F©³½u³B²z¡A°õ¦æ®É¡A¥i¥H¥Î¡§Alt-R¡¨¼öÁä¨Ó«ö°Ê³o¤@«ö¶s¡C¦P¼Ë¡A±z¥i¥H±N¨ä¥¦ªº¨â­Ó«ö¶sButton2©MButton3ªºCaptionÄݩʧ令»Ý­nªº§Îª¬«ü¥Ü¡AÄ´¦p¡§&RoundRec¡¨¡B¡§&Ellipse¡¨¡C¡@

1.2.4.2 ³]©wµ¡Å骺¯Ê¬Ù«ö¶s¡@

             ¥i¥H§â¬Y­Ó«ö¶s§@¬°µøµ¡¤Wªº¯Ê¬Ù«ö¶s¡ADelphi·|¬°«ö¶s¥[¤W¦³¶Â¦âªºÃä½t¡C°õ¦æ®É¡A¦^¨®§Y¬Û·í©ó³Q«ö¤U¡C¥u»Ý±N¦¹«ö¶sªºDefaultÄݩʱqFalse§ï¦¨True¡A§Y±N¥¦³]¬°µ¡Å骺¯Ê¬Ù«ö¶s¡CÂI°ÊDefaultÄÝ©Ê¡A¦b¥kºÝªº­È«á­±³sÄò«ö¨â¤U¥ªÁä¡A©Î±q¤U©Ô¤è¶ô¤¤¿ï¨úTrue¡A§Y¥i§ïÅܳo¤@ÄÝ©Ê¡CDelphi¤¤¦³³\¦h¥u¦³True¡BFalse¨â­ÓÄݩʪº³¡¥ó¡A³sÄò«ö¨â¤U¥ªÁä¥i¥H¦b³o¨â­Ó­È¤§¶¡¤Á´«¡C


«á¤@­¶
«e¤@­¶
¦^¥Ø¿ý
¦^­º­¶