|
| ̤²ò·è |
| ²ò·è |
| Ää»ß |
| ºï½üÍ×ÀÁ |
|
2017/8/19(Sat) 23:50:45|NO.81016
¡¡ÍÍ¡¹¤Ê¥µ¥¤¥È¤Î¥µ¥ó¥×¥ë¤ò¸«¤Ê¤¬¤é¡¢¥é¥¸¥ª¥Ü¥¿¥ó¤òÀ©ºî¤·¤Æ¤¤¤Þ¤¹¡£
¡¡°Ê²¼¤Ï°ìÎã¤Ç¡¢Â¾¤Ë¤âbuttonÌ¿Îá¤ò»È¤¦¤â¤Î¡¢winobj¤Çºî¤ë¤â¤Î¤Ê¤ÉÊ£¿ô¤ò»î¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¤·¤«¤·¡¢Â¾¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¸«¤é¤ì¤ë¤â¤Î¤Î¤è¤¦¤Ë¡¢¾å²¼Ìð°õ¥¡¼¤Ç¤Î¹àÌÜÁªÂò¤¬¤Ç¤¤Þ¤»¤ó¡£
¡¡¤â¤Á¤í¤ó¡¢¥¡¼ÆþÎϤò´Æ»ë¤·¤ÆÀÚ¤êÂؤ¨¤ë¤³¤È¤Ï¤Ç¤¤ë¤Î¤Ç¤·¤ç¤¦¤¬¡¢½ÐÍè¤ì¤ÐÀµ¹¶Ë¡¤Ç¹Ô¤¤¿¤¤¤È»×¤Ã¤Æ¤¤¤Þ¤¹¡£
¡¡¤¦¤Þ¤¯¥¡¼¥Ü¡¼¥ÉÁàºî¤Ç¤¤ë¥é¥¸¥ª¥Ü¥¿¥ó¤òÄáµ×ÊýË¡¤ò¤´Â¸ÃΤÎÊý¡¢¤ª¶µ¤¨¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
pos 10,10
objsize 250,40
chkbox get("delete","Words"),tmp
objskip stat,1
h1=objinfo(stat,2)
SetWindowLong h1,-16,$50020009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_GROUP
chkbox get("trash","Words"),tmp2
h2=objinfo(stat,2)
SetWindowLong h2,-16,$50000009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON
|
|
2017/8/20(Sun) 21:32:50|NO.81027
>ÍÍ¡¹¤Ê¥µ¥¤¥È¤Î¥µ¥ó¥×¥ë¤ò¸«¤Ê¤¬¤é¡¢¥é¥¸¥ª¥Ü¥¿¥ó¤òÀ©ºî¤·¤Æ¤¤¤Þ¤¹¡£
¥é¥¸¥ª¥Ü¥¿¥ó¤ò»È¤Ã¤Æ¤ë¤Î¤«¡©
¼«ºî¤Î¥é¥¸¥ª¥Ü¥¿¥ó¡¦¥³¥ó¥È¥í¡¼¥ë¤òºî¤Ã¤Æ¤ë¤Î¤«¡©
¤É¤Á¤é¡©
>°Ê²¼¤Ï°ìÎã¤Ç¡¢Â¾¤Ë¤âbuttonÌ¿Îá¤ò»È¤¦¤â¤Î¡¢winobj¤Çºî¤ë¤â¤Î¤Ê¤ÉÊ£¿ô¤ò»î¤·¤Æ¤¤¤Þ¤¹¡£
>¤·¤«¤·¡¢Â¾¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¸«¤é¤ì¤ë¤â¤Î¤Î¤è¤¦¤Ë¡¢¾å²¼Ìð°õ¥¡¼¤Ç¤Î¹àÌÜÁªÂò¤¬¤Ç¤¤Þ¤»¤ó¡£
¥°¥ë¡¼¥×¥Ü¥Ã¥¯¥¹¤Ê¤É¤¬´Ø·¸¤·¤Þ¤¹¡£
ʬ¤«¤ê¤Þ¤¹¤«¡©
>¤â¤Á¤í¤ó¡¢¥¡¼ÆþÎϤò´Æ»ë¤·¤ÆÀÚ¤êÂؤ¨¤ë¤³¤È¤Ï¤Ç¤¤ë¤Î¤Ç¤·¤ç¤¦¤¬¡¢½ÐÍè¤ì¤ÐÀµ¹¶Ë¡¤Ç¹Ô¤¤¿¤¤¤È»×¤Ã¤Æ¤¤¤Þ¤¹¡£
¤Ä¤Þ¤ê¡¢ÉáÄÌ¤Ë BS_AUTORADIOBUTTON ¥¹¥¿¥¤¥ë¤ÎÆ°ºî¤ÇÎɤ¤¤È¤¤¤¦»ö¤À¤è¤Í¡£
>¤¦¤Þ¤¯¥¡¼¥Ü¡¼¥ÉÁàºî¤Ç¤¤ë¥é¥¸¥ª¥Ü¥¿¥ó¤òÄáµ×ÊýË¡¤ò¤´Â¸ÃΤÎÊý¡¢¤ª¶µ¤¨¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
¥À¥¤¥¢¥í¥°¤ÈƱ¤¸¤è¤¦¤Ê¥¡¼Áàºî¤Ç¤¹¤è¤Í¡£
|
|
2017/8/20(Sun) 22:23:52|NO.81028
>¥¡¼ÆþÎϤò´Æ»ë¤·¤ÆÀÚ¤êÂؤ¨¤ë¤³¤È¤Ï¤Ç¤¤ë¤Î¤Ç¤·¤ç¤¦¤¬
HSP¤Ç¤Ï¤³¤Ã¤Á¤¬Àµ¹¶Ë¡¤Ç¤¹¡£
¤¢¤Ê¤¿¸À¤¦Àµ¹¶Ë¡¤Ï¥á¥Ã¥»¡¼¥¸¥ë¡¼¥×¤ò¤É¤¦¤Ë¤«¤·¤Ê¤¤¤È¤¤¤±¤Ê¤¤¤Î¤ÇHSP¤Ç¤ÏÆñ¤·¤¤¤Ç¤¹¡£
̵Íý¤ä¤ê²¿¤È¤«¤¹¤ëÊýË¡¤â¤¢¤ë¤ß¤¿¤¤¤Ç¤¹¤¬¤½¤ì¤è¤ê¤âÁÇľ¤ÊÊýË¡¤Ç¤ä¤Ã¤¿Êý¤¬¤¤¤¤¤Ç¤¹¡£
|
|
2017/8/21(Mon) 00:16:02|NO.81030
>> ²Ê³ØÂÀϺ ÍÍ
¡¡¥³¥ó¥È¥í¡¼¥ë¥Ñ¥Í¥ë¤Ê¤É¤Ç¤â¤è¤¯¤ß¤ë¥é¥¸¥ª¥Ü¥¿¥ó¤òºî¤Ã¤Æ¤¤¤Þ¤¹¡£
¡¡¤´»ØŦ¤ÎÄ̤ꡢBS_AUTORADIOBUTTON¤ÈƱ¤¸µóÆ°¤Î¤â¤Î¤Ç¤¹¡£
¡¡¥°¥ë¡¼¥×¥Ü¥Ã¥¯¥¹¤Ë¤Ä¤¤¤Æ¤Ï¡¢ºîÀ®ÊýË¡¤ÏÃΤäƤ¤¤Þ¤¹¤¬Ã±¤Ê¤ë¸«¤«¤±¾å¤Î°ÕÌ£¤·¤«¤Ê¤¤¤â¤Î¤Èǧ¼±¤·¤Æ¤¤¤Þ¤¹¡£
¡¡(MSDN¤Ë¤â¸«¤¿Ìܤȥ¢¥¯¥»¥¹¥¡¼ÀßÄê°Ê¾å¤Î¸ú²Ì¤Ï¤Ê¤¤¤È¤Îµ½Ò¤¬¤¢¤ê¤Þ¤·¤¿¤Î¤Ç¡¦¡¦¡¦)
>> eoe ÍÍ
¡¡¤É¤¦¤·¤Æ¤â¤à¤º¤«¤·¤½¤¦¤Ê¤é¡¢¤½¤¦¤·¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
¡¡¤¿¤À¡¢¤³¤Î¤è¤¦¤ÊÊýË¡¤Ç¤Ï¥â¥¸¥å¡¼¥ë²½¤âÆñ¤·¤¯¡¢¤Ç¤¤ì¤ÐÈò¤±¤¿¤¤¤È»×¤¤¼ÁÌ䤵¤»¤Æ¤¤¤¿¤À¤¤Þ¤·¤¿¡£
¡¡ºòÆü¤Î¥³¡¼¥É¤Ë¤ÏÈ´¤±¤â¿¤«¤Ã¤¿¤Î¤Ç¡¢¤´»ØŦ夤¤¿¥°¥ë¡¼¥×¥Ü¥Ã¥¯¥¹¤â°ì±þºî¤Ã¤¿¤¦¤¨¤Ç¤Î¥µ¥ó¥×¥ë¤ò²¼¤ËÄ¥¤êÉÕ¤±¤Þ¤¹¡£
»ä¤¬Ê¬¤«¤Ã¤Æ¤¤¤ë¤Î¤Ï¤³¤³¤Þ¤Ç¤Ç¤¹¡£
#uselib "user32.dll"
#func SetWindowLong "SetWindowLongA" sptr,sptr,sptr
//¥°¥ë¡¼¥×¥Ü¥Ã¥¯¥¹ºîÀ®
winobj "BUTTON","¥°¥ë¡¼¥×",0,$50400107,400,400
//$50400107=WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | BS_GROUPBOX | BS_LEFT
//WS_CLIPSIBLINGS¤Î°ÕÌ£¤ÏÉÔÌÀ¤À¤¬¡¢¥µ¥ó¥×¥ë¤Ë¹ç¤Ã¤¿¤Î¤Ç¤Ä¤±¤Æ¤ª¤¯
//¥é¥¸¥ª¥Ü¥¿¥óºîÀ®
pos 100,100
chkbox "ÁªÂò»è1",tmp
h1=objinfo(stat,2)
SetWindowLong h1,-16,$50020009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_GROUP
chkbox "ÁªÂò»è2",tmp2
h2=objinfo(stat,2)
SetWindowLong h2,-16,$50000009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON
stop
| |
|
2017/8/21(Mon) 08:53:03|NO.81040
¤¸¤ã¤¢¤½¤Î¥¹¥¯¥ê¥×¥È¤ÇÆ°¤«¤¹¥µ¥ó¥×¥ë¤òºÜ¤»¤Þ¤¹¡£
¤Ç¤â¥á¥Ã¥»¡¼¥¸¥ë¡¼¥×¤ò¥¹¥¯¥ê¥×¥È¤Ç¹Ô¤¦¤Î¤Ï¤¤¤í¤¤¤íÀ©Ì󤢤ꤽ¤¦¤À¤·¼ÂÍÑÀ¤Ï¤¢¤ê¤Þ¤»¤ó¡£
#include "user32.as"
//¥°¥ë¡¼¥×¥Ü¥Ã¥¯¥¹ºîÀ®
winobj "BUTTON","¥°¥ë¡¼¥×",0,$50400107,400,400
//$50400107=WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | BS_GROUPBOX | BS_LEFT
//WS_CLIPSIBLINGS¤Î°ÕÌ£¤ÏÉÔÌÀ¤À¤¬¡¢¥µ¥ó¥×¥ë¤Ë¹ç¤Ã¤¿¤Î¤Ç¤Ä¤±¤Æ¤ª¤¯
//¥é¥¸¥ª¥Ü¥¿¥óºîÀ®
pos 100,100
chkbox "ÁªÂò»è1",tmp
h1=objinfo(stat,2)
SetWindowLong h1,-16,$50020009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_GROUP
chkbox "ÁªÂò»è2",tmp2
h2=objinfo(stat,2)
SetWindowLong h2,-16,$50000009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON
SetFocus h1
dim msg,7
repeat
GetMessage varptr(msg),0,0,0
if stat==-1 | stat==0:break
IsDialogMessage hwnd,varptr(msg)
if stat:continue
TranslateMessage varptr(msg)
DispatchMessage varptr(msg)
loop
end
|
|
2017/8/21(Mon) 09:01:27|NO.81041
oncmd ¤Ç¥á¥Ã¥»¡¼¥¸¤ò½èÍý¤Ç¤¤ë¡£
¸½ºß¤Î¥Õ¥©¡¼¥«¥¹¤¬¥é¥¸¥ª¥Ü¥¿¥ó¤À¤Ã¤¿¾ì¹ç¤ÇÊý¸þ¥¡¼¤ò²¡¤µ¤ì¤¿¾ì¹ç¤Ë°Ü¹Ô¤·¤¿¤¤¥é¥¸¥ª¥Ü¥¿¥ó¤Ë¥Õ¥©¡¼¥«¥¹¤ò°Ü¤»¤ÐÁàºî¤Ç¤¤ë¤è¤Í¡£
|
|
2017/8/21(Mon) 09:44:13|NO.81042
¼¡¤Î¥½¡¼¥¹¥³¡¼¥É¤Ï£Ã¸À¸ì¤Ç¡Öñ½ã¤Ê¥¦¥¤¥ó¥É¥¦¡×¤òºîÀ®¤¹¤ëÉôʬ¤Ç¤¹¡£
//------------------------------------------------
// ¥á¥¤¥ó´Ø¿ô
//------------------------------------------------
extern int WINAPI _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow )
{
LPCTSTR lpClassName = TEXT("XXXX_WndClass");
LPCTSTR lpTitleName = TEXT("¥¥ã¥×¥·¥ç¥ó");
MSG Msg;
if ( funcWindowClass(hInstance,lpClassName) == 0 ){
return -1;
}
if ( funcCreateWindow(hInstance,lpClassName,lpTitleName,nCmdShow) == NULL ){
return -2;
}
while ( GetMessage(&Msg,NULL,0,0) > 0 ){
TranslateMessage( &Msg );
DispatchMessage( &Msg );
}
return Msg.wParam;
}
¼¡¤Î¥½¡¼¥¹¥³¡¼¥É¤â£Ã¸À¸ì¤Ç¤¹¤¬¡Ö¥À¥¤¥¢¥í¥°¡¦¥¦¥¤¥ó¥É¥¦¡×¤òºîÀ®¤¹¤ëÆâÍƤǤ¹¡£
//------------------------------------------------
// ¥á¥¤¥ó´Ø¿ô
//------------------------------------------------
extern int WINAPI _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow )
{
LPCTSTR lpClassName = TEXT("XXXX_WndClass");
HWND hWnd;
MSG Msg;
if ( funcDialogClass(hInstance,lpClassName) == 0 ){
return -1;
}
if ( (hWnd = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_DIALOG01),NULL,mainDialogProc)) == NULL ){
return -2;
}
while ( GetMessage(&Msg,NULL,0,0) > 0 ){
if ( !IsDialogMessage(hWnd,&Msg) ){ // ¤³¤³¤ËÃíÌÜ
TranslateMessage( &Msg );
DispatchMessage( &Msg );
}
}
return Msg.wParam;
}
¾åµ¤Î IsDialogMessage ´Ø¿ô¤ËÃíÌܤ·¤Æ¤¯¤À¤µ¤¤¡£
¤³¤Î£±¹Ô¤òÆþ¤ì¤ë¤È¥À¥¤¥¢¥í¥°¤ÈƱ¤¸¥¡¼Áàºî¤Ë¤Ê¤ê¤Þ¤¹¡£
¤·¤«¤·¡¢HSP¤Î¥¦¥¤¥ó¥É¥¦¤Ï¡Öñ½ã¤Ê¥¦¥¤¥ó¥É¥¦¡×¤È¤·¤ÆÆâÉô¤Ç½èÍý¤µ¤ì¤Æ¤Þ¤¹¡£
¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ï¡¢IsDialogMessage ´Ø¿ô¤¬Â¸ºß¤·¤Ê¤¤¤¿¤á¤Ë
¥À¥¤¥¢¥í¥°¤ÈƱ¤¸¥«¡¼¥½¥ë°ÜÆ°¥¡¼¤Î½èÍý¤Ï¹Ô¤¨¤Þ¤»¤ó¡£
¤È¤³¤í¤¬ objskip Ì¿Îá¤ÎÀâÌÀ¤òÆɤà¤È¼¡¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤Þ¤¹¡£
Ä̾ï¤Ï¡¢¥ª¥Ö¥¸¥§¥¯¥È¤òÇÛÃÖ¤·¤¿Ãʳ¬¤ÇºÇŬ¤Ê¥â¡¼¥É¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢
¥Õ¥©¡¼¥«¥¹°ÜÆ°¥â¡¼¥É¤òºÆÀßÄꤹ¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
Æüì¤ÊÌò³ä¤ò²Ì¤¿¤¹¥ª¥Ö¥¸¥§¥¯¥È¤À¤±¡¢¥Õ¥©¡¼¥«¥¹°ÜÆ°¥â¡¼¥ÉÊѤ¨¤¿¤ê¡¢
winobjÌ¿Îá¤Ë¤è¤ê¥·¥¹¥Æ¥àÄêµÁ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¿·¤·¤¯Äɲä·¤¿¾ì¹ç¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
¤Þ¤¿¡¢objskip Ì¿Îá¤Î¥µ¥ó¥×¥ë(calcsheet.hsp)¤ò¼Â¹Ô¤¹¤ë¤È[TAB]¥¡¼¤Î°ÜÆ°¤¬²Äǽ¤Ç¤¹¤Í¡£
´Êñ¤Ê¥µ¥ó¥×¥ë¤òºî¤Ã¤Æ³Îǧ¤·¤Þ¤·¤¿¤¬¡¢WS_TABSTOP ¥¹¥¿¥¤¥ë¤¬¤Ê¤¯¤Æ¤â[TAB]¥¡¼¤Ç°ÜÆ°¤Ç¤¤¿¤ê¡¢
Êý¸þ¥¡¼¤Î[¢«]¡¢[¢¬]¡¢[¢]¡¢[¢ª]¥¡¼¤Ç¤ÏÁ´¤¯°ÜÆ°¤·¤Þ¤»¤ó¡£
¤³¤Î¤³¤È¤«¤é HSP ¤ÏÆâÉô¤Ç IsDialogMessage ´Ø¿ô¤ÈƱÅù(TAB¤Î¤ß)¤Î½èÍý¤ò¹Ô¤Ã¤Æ¤ë¤è¤¦¤Ç¤¹¡£
¤½¤¦¤Ê¤ë¤È HSP ¤ÎÆâÉô¤Ç¤Ï WS_TABSTOP¡¢WS_GROUP ¤Î¥¹¥¿¥¤¥ë¤Ï¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤Ê¤¤¤À¤í¤¦¤·¡¢
ÉáÄ̤˹ͤ¨¤ë¤ÈÊý¸þ¥¡¼¤Î[¢«]¡¢[¢¬]¡¢[¢]¡¢[¢ª]¥¡¼¤Ç¤Ï°ÜÆ°ÉÔ²Äǽ¤Ç¤¹¡£
¢
eoe ¤µ¤ó¤¬¡¢´û¤Ë²ò·èºö¤òÄ󼨤·¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¤Í¡£
MillkeySoftw¤µ¤ó¤Ø¡£
> oncmd ¤Ç¥á¥Ã¥»¡¼¥¸¤ò½èÍý¤Ç¤¤ë¡£
> ¸½ºß¤Î¥Õ¥©¡¼¥«¥¹¤¬¥é¥¸¥ª¥Ü¥¿¥ó¤À¤Ã¤¿¾ì¹ç¤ÇÊý¸þ¥¡¼¤ò²¡¤µ¤ì¤¿¾ì¹ç¤Ë°Ü¹Ô¤·¤¿¤¤¥é¥¸¥ª¥Ü¥¿¥ó¤Ë¥Õ¥©¡¼¥«¥¹¤ò°Ü¤»¤ÐÁàºî¤Ç¤¤ë¤è¤Í¡£
´Êñ¤Ê¥µ¥ó¥×¥ë¤òºî¤Ã¤Æ¤ß¤Þ¤·¤¿¤¬¡¢¾å¼ê¤¯Æ°¤¤Þ¤»¤ó¤Ç¤·¤¿¤è¡£
oncmd ¤Ç WM_KEYDOWN ¥á¥Ã¥»¡¼¥¸¤ò½èÍý¤¹¤ì¤ÐÎɤ¤¤«¤È»×¤Ã¤¿¤¬¡¢
[TAB]¥¡¼¤ò°ìÅ٤ⲡ¤µ¤Ê¤±¤ì¤ÐÊý¸þ¥¡¼¤ò½èÍý¤Ç¤¤ë¤¬¡¢
[TAB]¥¡¼¤ò°ìÅÙ²¡¤¹¤È WM_KEYDOWN ¥á¥Ã¥»¡¼¥¸¤ÇÊý¸þ¥¡¼¤ò¥¥ã¥Ã¥Á¤Ç¤¤Ê¤¤¡£
| |
|
2017/8/21(Mon) 09:52:10|NO.81043
Äɵ¡£
ÌÌÇò¤¤¥Æ¡¼¥Þ¤À¤Ã¤¿¤Î¤Ç¥µ¥ó¥×¥ë¤òºîÀ®¤·¤Æ¤ß¤Þ¤·¤¿¡£
//------------------------------------------------------------------------------
// ¥é¥¸¥ª¥Ü¥¿¥ó¤Î¥°¥ë¡¼¥×²½(3) by ²Ê³ØÂÀϺ
//==============================================================================
// @URL(http://hsp.tv/play/pforum.php?mode=all&num=81016)¢ª¡Ö¥¡¼¥Ü¡¼¥É¤«¤éÀµ¤·¤¯Áàºî¤Ç¤¤ë¥é¥¸¥ª¥Ü¥¿¥ó¤ÎÀßÃÖ¡×
//------------------------------------------------------------------------------
#include "User32.as"
//--------------------------------------
// µ¹æÄê¿ô(APIÄê¿ô)
//--------------------------------------
#const global NULL 0
#const global BM_GETCHECK $000000F0
#const global BM_SETCHECK $000000F1
#const global BM_SETSTYLE $000000F4
#const global BS_AUTORADIOBUTTON $00000009
#
#const global GWL_STYLE $FFFFFFF0
#const global WS_TABSTOP $00010000
#const global WS_GROUP $00020000
//--------------------------------------
// ÎóµóÄê¿ô(¥ª¥Ö¥¸¥§¥¯¥ÈID)
//--------------------------------------
#enum RID_RADIO10=0
#enum RID_RADIO11
#enum RID_RADIO12
#enum RID_RADIO13
#enum RID_RADIO14
#
#enum RID_RADIO20
#enum RID_RADIO21
#enum RID_RADIO22
#
#enum RID_RADIO30
#enum RID_RADIO31
#enum RID_RADIO32
#enum RID_RADIO33
#
#enum MAX_CONTROL
//--------------------------------------
// ¥á¥¤¥óÉô
//--------------------------------------
*Init
dim Msg,7 ;Msg¹½Â¤ÂÎ
nRadio1=0 ;¥°¥ë¡¼¥×¡
nRadio2=1 ;¥°¥ë¡¼¥×¢
nRadio3=3 ;¥°¥ë¡¼¥×£
*Main
screen 0,640,480,SCREEN_NORMAL|SCREEN_FIXEDSIZE
syscolor 15:boxf:color:title "¥é¥¸¥ª¥Ü¥¿¥ó¤Î¥°¥ë¡¼¥×²½(3) by ²Ê³ØÂÀϺ"
;ÇÛÃÖ(¥°¥ë¡¼¥×¡)
objsize 200,25
mes ""
repeat 5
button gosub strf("¥°¥ë¡¼¥×¡¡§¥é¥¸¥ª¥Ü¥¿¥ó(%d)",cnt+10), *RadioButton1
SetGroupTabStop objinfo_hwnd(stat)
loop
;ÇÛÃÖ(¥°¥ë¡¼¥×¢)
objsize 200,25
mes ""
repeat 3
button gosub strf("¥°¥ë¡¼¥×¢¡§¥é¥¸¥ª¥Ü¥¿¥ó(%d)",cnt+20), *RadioButton2
SetGroupTabStop objinfo_hwnd(stat)
loop
;ÇÛÃÖ(¥°¥ë¡¼¥×£)
objsize 200,25
mes ""
repeat 4
button gosub strf("¥°¥ë¡¼¥×£¡§¥é¥¸¥ª¥Ü¥¿¥ó(%d)",cnt+30), *RadioButton3
SetGroupTabStop objinfo_hwnd(stat)
loop
;½é´üÃÍ
SetRadioButton RID_RADIO10,RID_RADIO14,nRadio1
SetRadioButton RID_RADIO20,RID_RADIO22,nRadio2
SetRadioButton RID_RADIO30,RID_RADIO33,nRadio3
;ÀßÄê(¥Õ¥©¡¼¥«¥¹)
objsel(RID_RADIO10+nRadio1)
repeat
;¥Ç¥Ð¥Ã¥°¾ðÊó
redraw 0
DrawDebug
redraw 1
;¥á¥Ã¥»¡¼¥¸¤Î½èÍý
GetMessage varptr(Msg),NULL,0,0
if(stat==0):break
if(stat< 0):break
;¤³¤³¤ËÃíÌÜ
IsDialogMessage hWnd,varptr(Msg)
if(stat):continue
TranslateMessage varptr(Msg)
DispatchMessage varptr(Msg)
loop
end
//--------------------------------------
// ¥°¥ë¡¼¥×¡¤ÎÁªÂò¼èÆÀ
//--------------------------------------
*RadioButton1
GetRadioButton RID_RADIO10,RID_RADIO14,nRadio1
return
//--------------------------------------
// ¥°¥ë¡¼¥×¢¤ÎÁªÂò¼èÆÀ
//--------------------------------------
*RadioButton2
GetRadioButton RID_RADIO20,RID_RADIO22,nRadio2
return
//--------------------------------------
// ¥°¥ë¡¼¥×£¤ÎÁªÂò¼èÆÀ
//--------------------------------------
*RadioButton3
GetRadioButton RID_RADIO30,RID_RADIO33,nRadio3
return
//--------------------------------------
// WS_GROUP¤ÈWS_TABSTOP¤òÀßÄê
//--------------------------------------
#deffunc SetGroupTabStop int _wnd_
SendMsg(_wnd_),BM_SETSTYLE,BS_AUTORADIOBUTTON,0
if(cnt==0){
GetWindowLong(_wnd_),GWL_STYLE
SetWindowLong(_wnd_),GWL_STYLE,stat|WS_GROUP|WS_TABSTOP
}
return
//--------------------------------------
// ¥é¥¸¥ª¥Ü¥¿¥ó¤Î¹àÌÜÈÖ¹æ¤òÀßÄê
//--------------------------------------
#deffunc SetRadioButton int _idFirst_,int _idLast_,int _no_
repeat((_idLast_)-(_idFirst_)+1),(_idFirst_)
SendMsg objinfo_hwnd(cnt),BM_SETCHECK,0,0
loop
SendMsg objinfo_hwnd(_idFirst_+_no_),BM_SETCHECK,1,0
return
//--------------------------------------
// ¥é¥¸¥ª¥Ü¥¿¥ó¤Î¹àÌÜÈÖ¹æ¤ò¼èÆÀ
//--------------------------------------
#deffunc GetRadioButton int _idFirst_,int _idLast_,var _no_
repeat((_idLast_)-(_idFirst_)+1),(_idFirst_)
SendMsg objinfo_hwnd(cnt),BM_GETCHECK,0,0
if(stat):_no_=(cnt)-(_idFirst_):break
loop
return(_no_)
//--------------------------------------
// ¥Ç¥Ð¥Ã¥°ÍѤΥ¹¥¿¥¤¥ë´Æ»ë
//--------------------------------------
#deffunc DrawDebug
syscolor 15:boxf:color
;¥¹¥¿¥¤¥ë¤Î´Æ»ë
pos 200,0
repeat MAX_CONTROL
GetWindowLong objinfo_hwnd(cnt),GWL_STYLE
if(stat & WS_GROUP):mes ""
mes strf("id%02d=$%08X",cnt,stat)
loop
;ÁªÂòÊÑ¿ô¤Î´Æ»ë
pos 400,0
mes ""
mes strf("nRadio1=%d",nRadio1)
mes strf("nRadio2=%d",nRadio2)
mes strf("nRadio3=%d",nRadio3)
return
//------------------------------------------------------------------------------
// End of sample196c(¥é¥¸¥ª¥Ü¥¿¥ó¤Î¥°¥ë¡¼¥×²½).hsp
//------------------------------------------------------------------------------
SetRadioButton¡¢GetRadioButtonÌ¿Îá¤ò»È¤¨¤Ð¥é¥¸¥ª¥Ü¥¿¥ó¤Î½èÍý¤Ï³Ú¤Ë¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£
¤Þ¤¿¡¢¤³¤Î¥µ¥ó¥×¥ë¤òºîÀ®¤·¤Æµ¤¤Å¤¤Þ¤·¤¿¤¬¡¢BS_AUTORADIOBUTTON ¥¹¥¿¥¤¥ë¤òÉÕ¤±¤¿¾ì¹ç¤Ï¡¢
¥é¥¸¥ª¥Ü¥¿¥ó¤Î WS_TABSTOP ¥¹¥¿¥¤¥ë¤¬¼«Æ°Åª¤Ë°ÜÆ°¤·¤Æ¤ë¤è¤¦¤Ç¤¹¤Í¡£
¢
¤³¤ì¤Ë¤è¤ê¡¢[TAB]¥¡¼¤Ç¼¡¤Î¥°¥ë¡¼¥×¤ÎÁªÂò¤µ¤ì¤¿¥é¥¸¥ª¥Ü¥¿¥ó¤Ë°ÜÆ°²Äǽ¤Ê¤Î¤Ç¤·¤ç¤¦¤Í¡£
¤³¤Î¥µ¥ó¥×¥ë¤ÇÃΤê¤Þ¤·¤¿¤è¡£
¤Ê¤ë¤Û¤É¤Í¡£MicroSoft¡£
| |
|
2017/8/21(Mon) 12:17:50|NO.81045
>> ²Ê³ØÂÀϺ ÍÍ
>> eoe ÍÍ
¡¡¤ï¤¶¤ï¤¶¥µ¥ó¥×¥ëºîÀ®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¡¦GetMessage
¡¦TranslateMessage
¡¦DispatchMessage
¤Ë¤Ä¤¤¤Æ¤ÏMSDN¤òÆɤó¤Ç¤â¤¤¤Þ¤¤¤Á¤è¤¯¤ï¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¤¬¡¢¤¤¤¿¤À¤¤¤¿¥¹¥¯¥ê¥×¥È¤ÇÌäÂê¤Ê¤¯Æ°¤¤½¤¦¤Ç¤¹¡£¤Þ¤¿ÊÙ¶¯¤·¤Þ¤¹¡£
¡¡ÀßÃÖ¤¹¤ë¥Ü¥¿¥ó¿ô¡¦¥°¥ë¡¼¥×¿ô¤Ë¾å¸Â¤òÀߤ±¤ì¤Ð¥â¥¸¥å¡¼¥ë²½¤â¤Ç¤¤ë¤È¤¤¤¦»ö¤âʬ¤«¤ê¤Þ¤·¤¿¡£
¡¡¡¦²¡¤µ¤ì¤¿¥Ü¥¿¥ó¤ÎID¤¬¤É¤³¤«¤Î¥·¥¹¥Æ¥àÊÑ¿ô¤Ê¤É¤ËÂåÆþ¤µ¤¨¤µ¤ì¤ì¤Ð¤¤¤¤¤ó¤Ç¤¹¤¬¡¦¡¦¡¦
¡¡¡¦¥Ü¥¿¥ó¤âCOMCTL¤ÎWM_NOTIFY¤Î¤è¤¦¤Ê·Á¤ÇÄÌÃΤò¤¯¤ì¤ì¤Ð¡¦¡¦¡¦
¡¡¡¦HSP¤Îobjskip¤¬WS_TABSTOP¤òÀßÄꤹ¤ëÊý¼°¤Ç¤¢¤ì¤Ð¡¦¡¦¡¦
¡¡¤È¡¢ÉÔ±¿¤Ê»ÅÍͤ¬½Å¤Ê¤Ã¤Æ¤¤¤Æ¡¢¤³¤ì°Ê¾å¤Ï¤É¤¦¤·¤è¤¦¤â¤Ê¤µ¤½¤¦¤Ç¤¹¤Í¡£
¡¡¤´²óÅú夤¤¿³§ÍÍ¡¢¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
|
|
2017/8/21(Mon) 13:34:24|NO.81046
´û¤Ë²ò·è¤·¤Æ¤ë¤è¤¦¤Ç¤¹¤¬¡Ö¤Ò¤È¸À¡×¥¢¥É¥Ð¥¤¥¹¤Ç¤¹¡£
> ¡¦²¡¤µ¤ì¤¿¥Ü¥¿¥ó¤ÎID¤¬¤É¤³¤«¤Î¥·¥¹¥Æ¥àÊÑ¿ô¤Ê¤É¤ËÂåÆþ¤µ¤¨¤µ¤ì¤ì¤Ð¤¤¤¤¤ó¤Ç¤¹¤¬¡¦¡¦¡¦
¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿¾ì¹ç¡¢¥¸¥ã¥ó¥×Àè¤Î¥é¥Ù¥ëÆâ¤Ç¡Östat¡×¤òÄ´¤Ù¤ë¤È¥Ü¥¿¥óID(¥ª¥Ö¥¸¥§¥¯¥ÈID)¤¬¼èÆÀ²Äǽ¤Ç¤¹¡£
> ¡¦¥Ü¥¿¥ó¤âCOMCTL¤ÎWM_NOTIFY¤Î¤è¤¦¤Ê·Á¤ÇÄÌÃΤò¤¯¤ì¤ì¤Ð¡¦¡¦¡¦
¥Ü¥¿¥ó¤Î¾ì¹ç¤Ï WM_COMMAND ¥á¥Ã¥»¡¼¥¸¤Î BN_xxx ¤ÇÄÌÃΤ¬Á÷¤é¤ì¤Æ¤¤Þ¤¹¡£
¡¦¥Ü¥¿¥ó(ÄÌÃÎ¥á¥Ã¥»¡¼¥¸)
http://wisdom.sakura.ne.jp/system/winapi/win32/win51.html
//--------------------------------------
// µ¹æÄê¿ô(APIÄê¿ô)
//--------------------------------------
#const global BN_CLICKED $00000000
#const global BN_PAINT $00000001
#const global BN_HILITE $00000002;BN_PUSHED¤ÈƱ¤¸
#const global BN_PUSHED $00000002
#const global BN_UNHILITE $00000003;BN_UNPUSHED¤ÈƱ¤¸
#const global BN_UNPUSHED $00000003
#const global BN_DISABLE $00000004
#const global BN_DBLCLK $00000005;BN_DOUBLECLICKED¤ÈƱ¤¸
#const global BN_DOUBLECLICKED $00000005
#const global BN_SETFOCUS $00000006
#const global BN_KILLFOCUS $00000007
> ¡¦HSP¤Îobjskip¤¬WS_TABSTOP¤òÀßÄꤹ¤ëÊý¼°¤Ç¤¢¤ì¤Ð¡¦¡¦¡¦
Ʊ´¶¤Ç¤¹¡£
¤Ê¤¼¡¢Æȼ«¤Ë objskip Ì¿Îá¤Ç WS_TABSTOP ¤â¤É¤¤òÀßÄꤹ¤ë¤Î¤À¤í¤¦¤«¡©
[TAB]¥¡¼¤Î°ÜÆ°¥ë¡¼¥Á¥ó¤Ç WS_TABSTOP ¥¹¥¿¥¤¥ë¤ò¸«¤Æ°ÜÆ°¤µ¤»¤ì¤ÐÎɤ¤¤Î¤Ë¤Í¡£
> ¤È¡¢ÉÔ±¿¤Ê»ÅÍͤ¬½Å¤Ê¤Ã¤Æ¤¤¤Æ¡¢¤³¤ì°Ê¾å¤Ï¤É¤¦¤·¤è¤¦¤â¤Ê¤µ¤½¤¦¤Ç¤¹¤Í¡£
ÉÔ±¿¤Ç¤¹¤«¡©
| |
|
2017/8/21(Mon) 22:38:23|NO.81052
>> ²Ê³ØÂÀϺ ÍÍ
¡¡´ðËÜŪ¤Ê»ö¤âʬ¤«¤Ã¤Æ¤ª¤é¤º¡¢¤¹¤ß¤Þ¤»¤ó¡£¤ï¤¶¤ï¤¶¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
¡¡¤ª¤«¤²¤µ¤Þ¤Ç¡¢°Ê²¼¤Î¤è¤¦¤Ë(¿¾¯¤Î½èÍý¤È¥á¥â¥ê¤Î̵Â̤Ϥ¢¤ê¤Þ¤¹¤¬)̵»ö¥â¥¸¥å¡¼¥ë¤Ë¤¹¤ë»ö¤¬½ÐÍè¤Þ¤·¤¿¡£¡£
¡¡º£²ó¤ÏÂçÊѤªÀ¤Ïäˤʤê¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
//-------------------------------------------------------------------------------------
//
// ¥é¥¸¥ª¥Ü¥¿¥óÀßÃÖ¡¦´ÉÍý¥â¥¸¥å¡¼¥ë
//
// V1.00 2017.08.21
//-------------------------------------------------------------------------------------
#module mod_radioButton
#uselib "user32.dll"
#func GetWindowLong "GetWindowLongA" sptr,sptr,sptr
#func SetWindowLong "SetWindowLongA" sptr,sptr,sptr
#func GetMessageA "GetMessageA" sptr,sptr,sptr,sptr
#func IsDialogMessage "IsDialogMessage" sptr,sptr
#func TranslateMessage "TranslateMessage" sptr
#func DispatchMessageA "DispatchMessageA" sptr
#deffunc radio str p1,int p2,int p3
//p1 ɽ¼¨Ê¸»úÎó(ANSI)
//p2 ¥°¥ë¡¼¥×¥Õ¥é¥°(³Æ¥°¥ë¡¼¥×ºÇ½é¤Î¥é¥¸¥ª¥Ü¥¿¥ó¤Ë¤Î¤ß£±¤ò»ØÄê
//p3 ½é´üÃͥե饰(½é´üÃͤȤ·¤ÆON¤ËÀßÄꤷ¤Æ¤ª¤¯¾ì¹ç¤Ë£±¤ò»ØÄê
if Init=0:radioInit
if p2=1:{
if group>4:return -2 //¥°¥ë¡¼¥×¿ô¤Î¾å¸Â¥ª¡¼¥Ð¡¼
group++
count.group=0
} else:{
if count.group>6:return -3 //¥°¥ë¡¼¥×Æâ¥Ü¥¿¥ó¿ô¤Î¾å¸Â¥ª¡¼¥Ð¡¼
count.group++
}
button gosub p1,*radioPush
ID.group.(count.group)=stat
if p2=1:{
SetWindowLong objinfo(stat,2),-16,$50030009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP
} else:{
SetWindowLong objinfo(stat,2),-16,$50000009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON
}
if p3=1:setRadioState group,count
return ID.group.(count.group)
#deffunc radioInit
//ɬÍפÊÊÑ¿ô¤Î³ÎÊݤʤÉ
//´ðËÜŪ¤Ë¤ÏÀßÃÖ»þ¤Ë¼«Æ°¤Ç¼Â¹Ô¤µ¤ì¤ë¤¬¡¢¼êÆ°¤Ç¤â¼Â¹Ô²Äǽ
group=-1 //¸½ºßºîÀ®Ãæ¤Î¥°¥ë¡¼¥×ÈÖ¹æ
dim count,5 //³Æ¥°¥ë¡¼¥×Æâ¤ÇºÇ¸å¤ËºîÀ®¤·¤¿¥¢¥¤¥Æ¥àÈÖ¹æ
dim sel,5
repeat 5
count.cnt=-1 //½é´üÃͤÏ-1¤Ë¤·¤Æ¤ª¤¯¡£
sel.cnt=-1
loop
dim ID,5,7 //ºÇÂ磵¥°¥ë¡¼¥×¡¢³Æ¥°¥ë¡¼¥×£·¸Ä¤Þ¤Ç
dim msg,7
init=1
return
#deffunc radioUnInit
//²èÌÌ¥¯¥ê¥¢¤ÎºÝ¤Ë¸Æ¤Ö»ö¤Ç¡¢¤³¤ì¤Þ¤Ç¤Î¥Ü¥¿¥ó¤Î¾ðÊó¤ò¥ê¥»¥Ã¥È
//¿¾¯¤Ï¥á¥â¥ê¤ÎÀáÌó¤Ë¤Ê¤ë
dim count,1
dim ID,1
dim sel,1
dim msg,1
init=0
return
*radioPush
tmp=stat
repeat 5
if tmp=ID.cnt.0:sel.cnt=0:break
if tmp=ID.cnt.1:sel.cnt=1:break
if tmp=ID.cnt.2:sel.cnt=2:break
if tmp=ID.cnt.3:sel.cnt=3:break
if tmp=ID.cnt.4:sel.cnt=4:break
if tmp=ID.cnt.5:sel.cnt=5:break
if tmp=ID.cnt.6:sel.cnt=6:break
loop
return
#deffunc radioCheck
//¥á¥¤¥ó¥ë¡¼¥×Æâ¤Ç¸Æ¤ó¤Ç¤â¤é¤¦¡£¥¡¼Áàºî¤Î¼õÉդΤ¿¤áɬÍס£
if init=0:return
GetMessageA varptr(msg),0,0,0
if stat==-1 | stat==0:return
IsDialogMessage hwnd,varptr(msg)
if stat:return
TranslateMessage varptr(msg)
DispatchMessageA varptr(msg)
return
#defcfunc getRadioState int p1
//¸½ºßÁªÂò¤µ¤ì¤Æ¤¤¤ë¹àÌܤΥ¤¥ó¥Ç¥Ã¥¯¥¹¤ò¼èÆÀ
//p1 ¥°¥ë¡¼¥×ÈÖ¹æ
if init=0:return -1 //½é´ü²½Á°
if p1<0:return -2 //¥°¥ë¡¼¥×Èֹ椬̵¸ú
if p1>5:return -2 //¥°¥ë¡¼¥×Èֹ椬̵¸ú
return sel.p1
#deffunc setRadioState int p1,int p2
//ÁªÂò¾õÂÖ¤ÎÊѹ¹
//p1 ¥°¥ë¡¼¥×ÈÖ¹æ
//p2 Êѹ¹¸åÁªÂò¹àÌܤΥ¤¥ó¥Ç¥Ã¥¯¥¹
if init=0:return -1 //½é´ü²½Á°
if p1<0:return -2 //¥°¥ë¡¼¥×Èֹ椬̵¸ú
if p1>5:return -2 //¥°¥ë¡¼¥×Èֹ椬̵¸ú
if sel.p1!=-1:sendmsg objinfo(ID.p1.(sel.p1),2),$F1,0,0 //BM_SETCHECK¤Ç¥Á¥§¥Ã¥¯¤òÆþ¤ì¤ë
sendmsg objinfo(ID.p1.p2,2),$F1,1,0 //BM_SETCHECK¤Ç¥Á¥§¥Ã¥¯¤òÆþ¤ì¤ë
sel.p1=p2
return
#deffunc setTabstop int p1
//p1¤Ç»ØÄꤷ¤¿ID¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ËWS_TABSTOP¤òÀßÄê
//¤³¤ì¤òÆþ¤ì¤Ê¤¤¤È¡¢¥é¥¸¥ª¥Ü¥¿¥ó°Ê³°¤ËTAB¥¡¼¤Ç¥Õ¥©¡¼¥«¥¹¤µ¤ì¤Ê¤¤
GetWindowLong objinfo(p1,2),-16,0
setWindowLong objinfo(p1,2),-16,stat | $10000 //WS_TABSTOP
return
#global
//*************** Sumple ***************
font "",32
objmode 2
pos 50,50
winobj "BUTTON","¥°¥ë¡¼¥×",0,$50400107,250,400
//$50400107=WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | BS_GROUPBOX | BS_LEFT
//WS_CLIPSIBLINGS¤Î°ÕÌ£¤ÏÉÔÌÀ¤À¤¬¡¢¥µ¥ó¥×¥ë¤Ë¹ç¤Ã¤¿¤Î¤Ç¤Ä¤±¤Æ¤ª¤¯
pos 70,90
objsize 200,40
radio "¥é¥¸¥ª£°",1,0
radio "¥é¥¸¥ª£±",0,0
radio "¥é¥¸¥ª£²",0,1
radio "¥é¥¸¥ª£³",0,0
radio "¥é¥¸¥ª£´",0,0
pos 350,50
winobj "BUTTON","¥°¥ë¡¼¥×",0,$50400107,250,400
pos 370,90
radio "¥é¥¸¥ª£°",1,0
radio "¥é¥¸¥ª£±",0,0
radio "¥é¥¸¥ª£²",0,0
radio "¥é¥¸¥ª£³",0,0
radio "¥é¥¸¥ª£´",0,0
//ÇØ·Ê¿§ÀßÄꡦ¥°¥ë¡¼¥×̾¤Î¥Õ¥©¥ó¥ÈÊѹ¹¡¡¾Êά
mes ""
button gosub "check",*check
setTabstop stat
repeat
wait 1
radioCheck
getkey key,13
if key:gosub *check
loop
*check
if getRadiostate(1)=-1:return
if getRadiostate(1)=-1:return
dialog getRadiostate(0)
dialog getRadiostate(1)
return
| |
|
2017/8/22(Tue) 00:40:31|NO.81055
> ¤ª¤«¤²¤µ¤Þ¤Ç¡¢°Ê²¼¤Î¤è¤¦¤Ë(¿¾¯¤Î½èÍý¤È¥á¥â¥ê¤Î̵Â̤Ϥ¢¤ê¤Þ¤¹¤¬)̵»ö¥â¥¸¥å¡¼¥ë¤Ë¤¹¤ë»ö¤¬½ÐÍè¤Þ¤·¤¿¡£¡£
Îɤ«¤Ã¤¿¤Ç¤¹¤Í¡£
Ä󼨤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¤Î¡Ö¤Á¤ç¤Ã¤Èµ¤¤Ë¤Ê¤Ã¤¿ÅÀ¡×¤ò¾Ò²ð¤·¤Þ¤¹¡£
¡ü£±¤ÄÌÜ
¥â¥¸¥å¡¼¥ëÆâ¤Î if-else ¹½Ê¸¤Ç¥Ö¥í¥Ã¥¯¤ò»È¤¦¤Î¤Ê¤é¤Ð¡¢¥Þ¥ë¥Á¥¹¥Æ¡¼¥È¥á¥ó¥È¤Î¥³¥í¥ó¤ÏÉÔÍפǤ¹¡£
if p2=1:{
if group>4:return -2 //¥°¥ë¡¼¥×¿ô¤Î¾å¸Â¥ª¡¼¥Ð¡¼
group++
count.group=0
} else:{
if count.group>6:return -3 //¥°¥ë¡¼¥×Æâ¥Ü¥¿¥ó¿ô¤Î¾å¸Â¥ª¡¼¥Ð¡¼
count.group++
}
¢
if p2=1{
if group>4:return -2 //¥°¥ë¡¼¥×¿ô¤Î¾å¸Â¥ª¡¼¥Ð¡¼
group++
count.group=0
}else{
if count.group>6:return -3 //¥°¥ë¡¼¥×Æâ¥Ü¥¿¥ó¿ô¤Î¾å¸Â¥ª¡¼¥Ð¡¼
count.group++
}
¡ü£²¤ÄÌÜ
¥â¥¸¥å¡¼¥ë¤Î¡ÖsetTabstop¡×Ì¿Îá¤Ë°ú¿ô¤Î¥Ð¥°¤¬¤¢¤ê¤Þ¤¹¡£
¡ßGetWindowLong objinfo(p1,2),-16,0
¢
¡ûGetWindowLong objinfo(p1,2),-16
GetWindowLong ´Ø¿ô¤Ï£²¤Ä¤Î°ú¿ô¤Î¤ß¤ÇÂ裳°ú¿ô¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¡ü£³¤ÄÌÜ
¤É¤³¤«¤Çõ¤·¤Æ¤¤¿¼¡¤Î¥µ¥ó¥×¥ë¤Ë¤Ï´Ö°ã¤¤¤¬´Þ¤Þ¤ì¤Æ¤Þ¤¹¡£
winobj "BUTTON","¥°¥ë¡¼¥×",0,$50400107,250,400
//$50400107=WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | BS_GROUPBOX | BS_LEFT
//WS_CLIPSIBLINGS¤Î°ÕÌ£¤ÏÉÔÌÀ¤À¤¬¡¢¥µ¥ó¥×¥ë¤Ë¹ç¤Ã¤¿¤Î¤Ç¤Ä¤±¤Æ¤ª¤¯
¢¬
¤³¤³¤Î¡Ö$50400107¡×¤Ï¡Ö$54000107¡×¤Ç¤¹¡£
#const global WS_DLGFRAME $00400000
#const global WS_CLIPSIBLINGS $04000000
¤Þ¤¿¡¢WS_CLIPSIBLINGS ¥¹¥¿¥¤¥ë¤Ï¡¢¿Æ¥¦¥¤¥ó¥É¥¦¤¬ºÆÉÁ²è¤¹¤ë¤È¤¤Ë
»Ò¥¦¥¤¥ó¥É¥¦(¥Ü¥¿¥ó¤Ê¤É)¤Î¶ë·Á¤òºÆÉÁ²è¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£
¤³¤ì¤Ë¤è¤ê¡¢¥Ü¥¿¥ó¤Ê¤É¤Î»Ò¥¦¥¤¥ó¥É¥¦¤¬ºÆÉÁ²è¤Ç¤Á¤é¤Ä¤«¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
¡¦¥¦¥£¥ó¥É¥¦ ¥¹¥¿¥¤¥ë
https://msdn.microsoft.com/ja-jp/library/czada357.aspx
¡ü£´¤ÄÌÜ
°ìÈÖ²¼¤Î¥µ¥ó¥×¥ë¤Ç repeat Æâ¤Ç¡Öwait 1¡×¤òÆþ¤ì¤Æ¤Þ¤¹¤¬É¬Íפ¢¤ê¤Þ¤»¤ó¡£
repeat
wait 1 ;ÉÔÍ×
radioCheck
getkey key,13
if key:gosub *check
loop
Íýͳ¤Ï radioCheck Ì¿ÎáÆâ¤Ç GetMessage ´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Æ¤ë¤«¤é¤Ç¤¹¡£
¤³¤Î´Ø¿ô¤½¤Î¤â¤Î¤¬ wait Ì¿Îá¤ÈƱ¤¸¤Ç¥á¥Ã¥»¡¼¥¸¤¬¥¥å¡¼¤ËÆþ¤ë¤Þ¤Ç°ì»þÄä»ß¤·¤Æ¤Þ¤¹¡£
¤Ä¤Þ¤ê¡¢¥µ¥ó¥×¥ë¤Î repeat Æâ¤Ï¡ÖradioCheck¡×¤ÇÄä»ß¾õÂ֤ˤ¢¤ê¡¢
¥¡¼ÆþÎϤʤɤΥ¤¥Ù¥ó¥È¤¬È¯À¸¤¹¤ë¤È GetMessage ´Ø¿ô¤«¤éÈ´¤±½Ð¤Þ¤¹¡£
¢
repeat
radioCheck ;Ìá¤êÃͤòÊÖ¤¹¤è¤¦¤Ë²þÎÉ!!
if(stat):break ;Ìá¤êÃÍ¤Ç break ¤¹¤ë
getkey key,13
if key:gosub *check
loop
;¤³¤³¤Ë onexit ¤ÈƱ¤¸½ªÎ»½èÍý¤ò½ñ¤±¤Þ¤¹¡£
dialog "¤³¤³¤Ë onexit ¤ÈƱ¤¸½ªÎ»½èÍý¤ò½ñ¤±¤Þ¤¹¡£",0,"³Îǧ"
end
¤³¤ÎÊýË¡¤À¤È HSP ¤Î onexit ¤ÇÀßÄꤷ¤¿¥é¥Ù¥ë¤Ë¤Ï¥¸¥ã¥ó¥×¤·¤Ê¤¤¤Ç½ªÎ»¤·¤Þ¤¹¡£
¤½¤Î¤¿¤á¤Ë repeat-loop ¹½Ê¸¤òÈ´¤±¤¿¸å¤ËƱ¤¸¡Ö½ªÎ»½èÍý¡×¤ò½ñ¤±¤Þ¤¹¡£
¤Ê¤ª¡¢HSP ¤Î onexit ¤ÇÀßÄꤷ¤¿¥é¥Ù¥ë¤Ë¥¸¥ã¥ó¥×¤µ¤»¤¿¤¤¾ì¹ç¤Ï¡¢
wait Ì¿Îᤫ await Ì¿Îá¤òÆþ¤ì¤¨¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤Í¡£
¤É¤Á¤é¤¬Îɤ¤¤«¤Ï¡¢¥â¥¸¥å¡¼¥ë¤ò»È¤¦Â¦¤Î¼«Í³¤È¤¹¤ë¤¿¤á¤Ë
radioCheck Ì¿Îá¤ÏÌá¤êÃͤòÊÖ¤¹¤è¤¦¤Ë¤·¤Æ¤ª¤¤Þ¤¹¡£
¤³¤ÎÌá¤êÃͤò¸«¤Æ break ¤·¤¿¾ì¹ç¤Ï onexit ¤Î¥é¥Ù¥ë¤Ë¥¸¥ã¥ó¥×¤·¤Ê¤¤¤¬¡¢
Ìá¤êÃͤòÆÉ¤ß¼Î¤Æ¤Æ wait Ì¿Îá¤Ê¤É¤òÁÞÆþ¤¹¤ì¤Ð onexit ¤Î¥é¥Ù¥ë¤Ë¥¸¥ã¥ó¥×¤¹¤ë»ÅÍͤǤ¹¡£
#deffunc radioCheck
//¥á¥¤¥ó¥ë¡¼¥×Æâ¤Ç¸Æ¤ó¤Ç¤â¤é¤¦¡£¥¡¼Áàºî¤Î¼õÉդΤ¿¤áɬÍס£
if(init==0):return 0
GetMessage varptr(msg),0,0,0
if(stat==-1)or(stat==0):return 1
IsDialogMessage hwnd,varptr(msg)
if(stat):return 0
TranslateMessage varptr(msg)
DispatchMessage varptr(msg)
return 0
¤Ê¤ª¡¢HSP ¤Î onexit ¤Î¥é¥Ù¥ë¤Ë¥¸¥ã¥ó¥×²Äǽ¤Ê»ÅÍͤǤ¢¤ì¤Ð¡¢
radioCheck Ì¿Îá¤ÎÊý¤Ë await ¤Ê¤É¤òµ½Ò¤¹¤ì¤ÐÎɤ¤¤Î¤Ç¤¹¡£
#deffunc radioCheck
//¥á¥¤¥ó¥ë¡¼¥×Æâ¤Ç¸Æ¤ó¤Ç¤â¤é¤¦¡£¥¡¼Áàºî¤Î¼õÉդΤ¿¤áɬÍס£
if(init==0):return
await ;ÄɲÃ(°ú¿ô¤Ê¤·)
GetMessage varptr(msg),0,0,0
if(stat==-1)or(stat==0):return
IsDialogMessage hwnd,varptr(msg)
if(stat):return
TranslateMessage varptr(msg)
DispatchMessage varptr(msg)
return
¤³¤ì¤Ê¤é¤Ð
repeat
radioCheck
getkey key,13
if(key):gosub *check
loop
¤³¤Î¤è¤¦¤Ë¤Ç¤¤Þ¤¹¤Í¡£
¡üºÇ¸å¤Ë¡Ö¤Á¤ç¤Ã¤È½¤Àµ¤·¤¿¡×¥Ð¡¼¥¸¥ç¥ó(V1.01)¤òºÜ¤»¤Æ¤ª¤¤Þ¤¹¡£
//-------------------------------------------------------------------------------------
//
// ¥é¥¸¥ª¥Ü¥¿¥óÀßÃÖ¡¦´ÉÍý¥â¥¸¥å¡¼¥ë
//
// V1.00 2017.08.21
// V1.01 2017.08.22
//-------------------------------------------------------------------------------------
#include "User32.as"
#ifndef __INCLUDE_MODRADIOBUTTON__
#define __INCLUDE_MODRADIOBUTTON__
#module mod_radioButton
#deffunc radio str p1,int p2,int p3
//p1 ɽ¼¨Ê¸»úÎó(ANSI)
//p2 ¥°¥ë¡¼¥×¥Õ¥é¥°(³Æ¥°¥ë¡¼¥×ºÇ½é¤Î¥é¥¸¥ª¥Ü¥¿¥ó¤Ë¤Î¤ß£±¤ò»ØÄê
//p3 ½é´üÃͥե饰(½é´üÃͤȤ·¤ÆON¤ËÀßÄꤷ¤Æ¤ª¤¯¾ì¹ç¤Ë£±¤ò»ØÄê
if(Init==0):radioInit
if(p2==1){
if(group>=5):return -2 //¥°¥ë¡¼¥×¿ô¤Î¾å¸Â¥ª¡¼¥Ð¡¼
group++
count.group=0
}else{
if(count.group>=7):return -3 //¥°¥ë¡¼¥×Æâ¥Ü¥¿¥ó¿ô¤Î¾å¸Â¥ª¡¼¥Ð¡¼
count.group++
}
button gosub p1,*radioPush
ID.group.(count.group)=stat
if(p2==1){
SetWindowLong objinfo_hwnd(stat),-16,$50030009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP
}else{
SetWindowLong objinfo_hwnd(stat),-16,$50000009 //WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON
}
if(p3==1):setRadioState group,count
return ID.group.(count.group)
#deffunc radioInit
//ɬÍפÊÊÑ¿ô¤Î³ÎÊݤʤÉ
//´ðËÜŪ¤Ë¤ÏÀßÃÖ»þ¤Ë¼«Æ°¤Ç¼Â¹Ô¤µ¤ì¤ë¤¬¡¢¼êÆ°¤Ç¤â¼Â¹Ô²Äǽ
group=-1 //¸½ºßºîÀ®Ãæ¤Î¥°¥ë¡¼¥×ÈÖ¹æ
dim count,5 //³Æ¥°¥ë¡¼¥×Æâ¤ÇºÇ¸å¤ËºîÀ®¤·¤¿¥¢¥¤¥Æ¥àÈÖ¹æ
dim sel,5
repeat 5
count.cnt=-1 //½é´üÃͤÏ-1¤Ë¤·¤Æ¤ª¤¯¡£
sel.cnt=-1
loop
dim ID,5,7 //ºÇÂ磵¥°¥ë¡¼¥×¡¢³Æ¥°¥ë¡¼¥×£·¸Ä¤Þ¤Ç
dim msg,7
init=1
return
#deffunc radioUnInit
//²èÌÌ¥¯¥ê¥¢¤ÎºÝ¤Ë¸Æ¤Ö»ö¤Ç¡¢¤³¤ì¤Þ¤Ç¤Î¥Ü¥¿¥ó¤Î¾ðÊó¤ò¥ê¥»¥Ã¥È
//¿¾¯¤Ï¥á¥â¥ê¤ÎÀáÌó¤Ë¤Ê¤ë
dim count,1
dim ID,1
dim sel,1
dim msg,1
init=0
return
*radioPush
tmp=stat
repeat 5
if(tmp=ID.cnt.0):sel.cnt=0:break
if(tmp=ID.cnt.1):sel.cnt=1:break
if(tmp=ID.cnt.2):sel.cnt=2:break
if(tmp=ID.cnt.3):sel.cnt=3:break
if(tmp=ID.cnt.4):sel.cnt=4:break
if(tmp=ID.cnt.5):sel.cnt=5:break
if(tmp=ID.cnt.6):sel.cnt=6:break
loop
return
#deffunc radioCheck
//¥á¥¤¥ó¥ë¡¼¥×Æâ¤Ç¸Æ¤ó¤Ç¤â¤é¤¦¡£¥¡¼Áàºî¤Î¼õÉդΤ¿¤áɬÍס£
if(init==0):return
await
GetMessage varptr(msg),0,0,0
if(stat==-1)or(stat==0):return
IsDialogMessage hwnd,varptr(msg)
if(stat):return
TranslateMessage varptr(msg)
DispatchMessage varptr(msg)
return
#defcfunc getRadioState int p1
//¸½ºßÁªÂò¤µ¤ì¤Æ¤¤¤ë¹àÌܤΥ¤¥ó¥Ç¥Ã¥¯¥¹¤ò¼èÆÀ
//p1 ¥°¥ë¡¼¥×ÈÖ¹æ
if(init==0):return -1 //½é´ü²½Á°
if(p1<0):return -2 //¥°¥ë¡¼¥×Èֹ椬̵¸ú
if(p1>5):return -2 //¥°¥ë¡¼¥×Èֹ椬̵¸ú
return sel.p1
#deffunc setRadioState int p1,int p2
//ÁªÂò¾õÂÖ¤ÎÊѹ¹
//p1 ¥°¥ë¡¼¥×ÈÖ¹æ
//p2 Êѹ¹¸åÁªÂò¹àÌܤΥ¤¥ó¥Ç¥Ã¥¯¥¹
if(init==0):return -1 //½é´ü²½Á°
if(p1<0):return -2 //¥°¥ë¡¼¥×Èֹ椬̵¸ú
if(p1>5):return -2 //¥°¥ë¡¼¥×Èֹ椬̵¸ú
if(sel.p1!=-1):sendmsg objinfo_hwnd(ID.p1.(sel.p1)),$F1,0,0 //BM_SETCHECK¤Ç¥Á¥§¥Ã¥¯¤òÆþ¤ì¤ë
sendmsg objinfo_hwnd(ID.p1.p2),$F1,1,0 //BM_SETCHECK¤Ç¥Á¥§¥Ã¥¯¤òÆþ¤ì¤ë
sel.p1=p2
return
#deffunc setTabstop int p1
//p1¤Ç»ØÄꤷ¤¿ID¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ËWS_TABSTOP¤òÀßÄê
//¤³¤ì¤òÆþ¤ì¤Ê¤¤¤È¡¢¥é¥¸¥ª¥Ü¥¿¥ó°Ê³°¤ËTAB¥¡¼¤Ç¥Õ¥©¡¼¥«¥¹¤µ¤ì¤Ê¤¤
GetWindowLong objinfo(p1,2),-16
SetWindowLong objinfo(p1,2),-16,stat | $10000 //WS_TABSTOP
return
//--------------------------------------
// ¥â¥¸¥å¡¼¥ëÄêµÁ¤Î½ª¤ï¤ê
//--------------------------------------
#global
#endif
//--------------------------------------
// ¥â¥¸¥å¡¼¥ëÄêµÁ¤ÎÆ°ºî¥µ¥ó¥×¥ë
//--------------------------------------
#if(0)
syscolor 15:boxf
font MSGOTHIC,32
objmode 2
pos 50,50
winobj "BUTTON","¥°¥ë¡¼¥×",0,$54000107,250,400
//$54000107=WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | BS_GROUPBOX | BS_LEFT
//WS_CLIPSIBLINGS¤Î°ÕÌ£¤ÏÉÔÌÀ¤À¤¬¡¢¥µ¥ó¥×¥ë¤Ë¹ç¤Ã¤¿¤Î¤Ç¤Ä¤±¤Æ¤ª¤¯
pos 70,90
objsize 200,40
radio "¥é¥¸¥ª£°",1,0
radio "¥é¥¸¥ª£±",0,0
radio "¥é¥¸¥ª£²",0,1
radio "¥é¥¸¥ª£³",0,0
radio "¥é¥¸¥ª£´",0,0
pos 350,50
winobj "BUTTON","¥°¥ë¡¼¥×",0,$54000107,250,400
pos 370,90
radio "¥é¥¸¥ª£°",1,0
radio "¥é¥¸¥ª£±",0,0
radio "¥é¥¸¥ª£²",0,0
radio "¥é¥¸¥ª£³",0,0
radio "¥é¥¸¥ª£´",0,0
//ÇØ·Ê¿§ÀßÄꡦ¥°¥ë¡¼¥×̾¤Î¥Õ¥©¥ó¥ÈÊѹ¹¡¡¾Êά
mes ""
button gosub "check",*check
setTabstop stat
repeat
radioCheck
getkey key,13
if(key):gosub *check
loop
*check
if(getRadiostate(1)<0):return
if(getRadiostate(1)<0):return
dialog getRadiostate(0)
dialog getRadiostate(1)
return
#endif
//------------------------------------------------------------------------------
// End of mod_radioButton.hsp
//------------------------------------------------------------------------------
¤³¤Î²þÎɥС¼¥¸¥ç¥ó¤Î¥Ý¥¤¥ó¥È¤Ï¡¢Â¿½Å include ¶Ø»ß¤ÎÂкö¤È
°ìÈÖ²¼¤Î¡Ö¥â¥¸¥å¡¼¥ëÄêµÁ¤ÎÆ°ºî¥µ¥ó¥×¥ë¡×¤Ë
¡Ö#if(0)¡×¤ò»È¤Ã¤Æ¤ëÅÀ¤Ç¤·¤ç¤¦¤«¤Í¡£
¢
¥â¥¸¥å¡¼¥ë¤Î½ñ¤Êý¤Î»²¹Í¤Ë¤É¤¦¤¾¡£
| |
|
2017/8/22(Tue) 03:21:16|NO.81056
¤Ê¤ó¤«¥á¥Ã¥»¡¼¥¸¥ë¡¼¥×¤ò¥¹¥¯¥ê¥×¥È¤Ç¹Ô¤¦ÊýË¡¤Ç²ò·è¤µ¤ì¤Æ¤ë¤ß¤¿¤¤¤Ç¤¹¤¬
¤¢¤Î¥µ¥ó¥×¥ë¤Ï¡¢¤ä¤í¤¦¤È¤¹¤ì¤Ð̵Íý¤ä¤ê¤Ë¤Ê¤ë¤³¤È¤ò¼¨¤·¤¿¤«¤Ã¤¿¤â¤Î¤Ç¤¢¤ê
»ä¤È¤·¤Æ¤ÏºÇ½é¤«¤é¸À¤Ã¤Æ¤ëÄ̤ê¤ä¤á¤¿Êý¤¬¤¤¤¤¤È»×¤¤¤Þ¤¹¡£
Fubuki¤µ¤ó¤Ï¥á¥Ã¥»¡¼¥¸¥ë¡¼¥×¤Î¤³¤È¤ò¤è¤¯¤ï¤«¤Ã¤Æ¤Ê¤¤¤ß¤¿¤¤¤Ç¤¹¤·¤É¤Î¤è¤¦¤ÊÉûºîÍѤ¬¤¢¤ë¤«¤â¤ï¤«¤é¤Ê¤¤¤Ç¤·¤ç¤¦¤·¡£
|
|
2017/8/22(Tue) 03:48:35|NO.81057
¤´»ØŦ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
½¤Àµ¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤·¤¿¡£
£´¡¥¤Î·ï¤Ë¤Ä¤¤¤Æ¤Ï¡¢Â¾¤ËÍÍ¡¹¤Ê¥â¥¸¥å¡¼¥ë¤È¤Î¶¦ÍѤ¬¹Í¤¨¤é¤ì¤ë(»ä¤Ï¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹¤ÎÇØ·Ê¿§Êѹ¹¤ä¥á¥Ë¥å¡¼¥Ð¡¼¤«¤é¤ÎÁàºî¡¢²èÌÌ¥µ¥¤¥ºÊѹ¹¤Ë¤è¤ë¥ª¥Ö¥¸¥§¥¯¥È¥µ¥¤¥º¡¦ÇÛÃÖÊѹ¹¤ò¼ÂÁõºÑ¤ß)¤¿¤á¡¢*radioCheckÆâ¤Çawait¤òÆþ¤ì¤ë»ö¤È¤·¤Þ¤·¤¿¡£¤³¤ÎÊýË¡¤¬¡¢°ìÈÖÁêÀÌäÂê¤òȯÀ¸¤µ¤»¤Ë¤¯¤¯¡¢¤É¤Î¤è¤¦¤Ê¥½¥Õ¥È¤ËÁȤ߹þ¤à¤È¤·¤Æ¤â¥á¥¤¥ó¤Î¥³¡¼¥É¤Ø¤Î±Æ¶Á¤¬¾¯¤Ê¤¤¤«¤È¹Í¤¨¤¿¤¿¤á¤Ç¤¹¡£
¡¡WS_CLIPSIBLINGS ¤Ë¤Ä¤¤¤Æ¤â¡¢MSDN¤ÎÆüËܸìÌõ¤¬¤ª¤«¤·¤¯¤Æº¤¤Ã¤Æ¤ª¤ê¤Þ¤·¤¿¡£(µ¡³£ËÝÌõ¤Ê¤Î¤Ç»ÅÊý¤Ê¤¤¤Ç¤¹¤¬)
¡¡¤Þ¤À¤Þ¤ÀÊÙ¶¯ÉÔ¤Ǥ¹¤¬¡¢¼ê¸µ¤Ë¤¢¤ë¥â¥¸¥å¡¼¥ë¤â¤¤Á¤ó¤È¤Þ¤È¤á¤Æ¾ÍèŪ¤Ë¸ø³«¤Ç¤¤ë¤è¤¦¡¢ÊÙ¶¯¤·¤Æ¤Þ¤¤¤ê¤Þ¤¹¡£
|
|
2017/8/23(Wed) 19:42:31|NO.81079
²ò·è¤·¤Æ¤Þ¤¹¤¬¡¢¸å¡¹ÌäÂê¤Ë¤Ê¤ê¤½¤¦¤ÊÅÀ¤Ë¤Ä¤¤¤ÆÊä¡£
>Fubuki¤µ¤ó
¾¤Î¥â¥¸¥å¡¼¥ë¤È¤ÎÁêÀ¤Ç¤¹¡©¤½¤ì¤é¤ÎÃæ¤Î¼ÂÁõ¤Ïoncmd¤ÇÆ°ºî¤¹¤ë¥³¡¼¥É¤È¿ä¬¤Ç¤¤Þ¤¹¤¬¡Ä
await¤Ï1Ì¿Îá¤Ç¥á¥Ã¥»¡¼¥¸¥ë¡¼¥×¤ò¹½À®¤¹¤ë¤è¤¦¤ÊÌ¿Îá¤Ê¤Î¤À¤«¤é¡¢¤½¤ì¤òÆþ¤ì¤ë¤È
¡Ö¥¤¥Ù¥ó¥È¤ÎȯÀ¸¥¿¥¤¥ß¥ó¥°¤Ë¤è¤Ã¤Æ½èÍý¥ë¡¼¥Á¥ó¤òÊѹ¹¤¹¤ë¡×¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¤è¡£
¤â¤·¡¢¥á¥Ã¥»¡¼¥¸¥ë¡¼¥×¤ò¥³¡¼¥É¾å¤Ëµ½Ò¤·¤Æ¤Ê¤ª¡¢
¡¦await¤äwait¡¢stop¤¬¤Ê¤¤¥³¡¼¥É¤ò²ó¤·¤Æ¤¤¤ë¤È¥Õ¥ê¡¼¥º¤·¤¿¤è¤¦¤Ê¾õÂ֤ˤʤë
¡¦on·ÏÌ¿Î᤬¤³¤ì¤é¤ÎÌ¿Îá¤Î¥¿¥¤¥ß¥ó¥°¤Ç¥¸¥ã¥ó¥×¤¹¤ë¤¿¤áɬÍ×
¤È¤¤¤Ã¤¿´¶³Ð¤Çawait¤òÆþ¤ì¤Æ¤¤¤ë¤Î¤Ê¤é¡¢¤½¤ì¤Ï°ã¤¤¤Þ¤¹¤è¡£
>²Ê³ØÂÀϺ¤µ¤ó
onexit¤ÏWM_CLOSEȯÀ¸»þ¤ÎHSPWindow¤Î´ðËÜÆ°ºî¤Ç¤¹¡£(OpenHSP¤ò¸«¤Æ¤ß¤ë¤È¤¤¤¤¤«¤È)
oncmd¤Ç½èÍý¤·¤Ê¤¤¸Â¤ê¥á¥Ã¥»¡¼¥¸¥ë¡¼¥×¤«¤éæ½Ð¤¹¤ëÁ°¤ËonexitÀè¤Î¥é¥Ù¥ë¤ËÈô¤Ó¤Þ¤¹¡£
(WM_CLOSE¤¬PostQuitMessage¤ò¸Æ¤ó¤Ç¤¤¤ë¤Î¤Ç)
¤½¤·¤Æ¥á¥Ã¥»¡¼¥¸¥ë¡¼¥×¤Îæ½Ð¸å¤Ë½ªÎ»½èÍý¤Ï½ñ¤±¤ë¤Ç¤·¤ç¤¦¤±¤É¤â¡¢¤½¤³¤Ç½ªÎ»¤ò(´ðËÜŪ¤Ë)µñÈݤǤ¤Þ¤»¤ó¡£
WM_QUIT¤ò°®¤ê¤Ä¤Ö¤¹/GetMessage¤Î¥¨¥é¡¼È¯À¸¤Ç¥×¥í¥°¥é¥à¤ò³¹Ô¤¹¤ë ¤³¤È¤Ë¤Ê¤ë¤«¤é¤Ç¤¹¡£
¥ª¥Þ¥±¡§
IsDialogMessage¤Ï¥À¥¤¥¢¥í¥°¥¦¥£¥ó¥É¥¦¤Ë¤ª¤¤¤Æ¡¢
Enter¥¡¼¤òÍ׵ᤷ¤Ê¤¤¥³¥ó¥È¥í¡¼¥ë¤ËÂФ·¤ÆEnter¥¡¼¤òÁ÷¤ê½Ð¤µ¤ì¤ë¤È¤¡¢¿Æ¡©¥¦¥£¥ó¥É¥¦¤ËWM_COMMAND¤òÁ÷¤ê½Ð¤·¤Þ¤¹¡£
¼ÂºÝ¤Ïɸ½à¥¦¥£¥ó¥É¥¦¤Ç¤¢¤Ã¤Æ¤â¡¢É¸½à¤Î·èÄê¥Ü¥¿¥óID(IDOK(1))¤¬(¸ºß¤¹¤ë/¤·¤Ê¤¤¤Ë¤«¤«¤ï¤é¤º)Á÷¤ê½Ð¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¸«¤¨¤Þ¤¹¡£
¤³¤ÎÆ°ºî¤¬Windowsɸ½àµ¡Ç½¤Ê¤Î¤Ç¤¢¤ì¤Ð(´Ä¶°Í¸¤Ç¤Ê¤¤¤Ê¤é)¡¢getkey¤ÇEnter¥¡¼¤ò¥¡¼ÆþÎÏÂÔ¤Á¤¹¤ëɬÍפ¬¤Ê¤¤¤Ç¤¹¡£
»ÄÇ°¤Ê¤¬¤é¤³¤Á¤é¤Ç¤Ï¤³¤ÎÆ°ºî¤¬É¸½àÆ°ºî¤Ê¤Î¤«´Ä¶°Í¸¤Ê¤Î¤«¤òÌÀµ¤·¤¿»ñÎÁ¤ò¸«¤Ä¤±¤é¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£
¾Ü¤·¤¤Êý¤Ê¤é¡Ä¡£(¤Þ¤ë¤Ê¤²)
| |
|
2017/8/24(Thu) 06:51:06|NO.81085
·¡ÌÚ¤µ¤ó¤Ø¡£
> ¤½¤·¤Æ¥á¥Ã¥»¡¼¥¸¥ë¡¼¥×¤Îæ½Ð¸å¤Ë½ªÎ»½èÍý¤Ï½ñ¤±¤ë¤Ç¤·¤ç¤¦¤±¤É¤â¡¢¤½¤³¤Ç½ªÎ»¤ò(´ðËÜŪ¤Ë)µñÈݤǤ¤Þ¤»¤ó¡£
³Î¤«¤Ë̵Íý¤Ç¤¹¤Í¡£¤³¤³¤Ç¤Ï¡£
> WM_QUIT¤ò°®¤ê¤Ä¤Ö¤¹/GetMessage¤Î¥¨¥é¡¼È¯À¸¤Ç¥×¥í¥°¥é¥à¤ò³¹Ô¤¹¤ë ¤³¤È¤Ë¤Ê¤ë¤«¤é¤Ç¤¹¡£
GetMessage´Ø¿ô¤ÇÈ´¤±¤¿¤é end ¤¹¤ë¤·¤«¤Ê¤¤¤«¤é¤Í¡£
Fubuki¤µ¤ó¤Ø¡£
GetMessage´Ø¿ô¤ò»È¤ï¤º¤Ë¼«ÎϤǽèÍý¤¹¤ëÊýË¡¤ò¾Ò²ð¤·¤Þ¤¹¡£
//------------------------------------------------------------------------------
// ¥é¥¸¥ª¥Ü¥¿¥ó¤Î¥°¥ë¡¼¥×²½(2) by ²Ê³ØÂÀϺ
//------------------------------------------------------------------------------
// @URL(http://hsp.tv/play/pforum.php?mode=all&num=81016)¢ª¡Ö¥¡¼¥Ü¡¼¥É¤«¤éÀµ¤·¤¯Áàºî¤Ç¤¤ë¥é¥¸¥ª¥Ü¥¿¥ó¤ÎÀßÃÖ¡×
//------------------------------------------------------------------------------
#include "User32.as"
//--------------------------------------
// µ¹æÄê¿ô(APIÄê¿ô)
//--------------------------------------
#const global BM_GETCHECK $000000F0
#const global BM_SETCHECK $000000F1
#const global BM_SETSTYLE $000000F4
#const global BM_CLICK $000000F5
#const global BS_AUTORADIOBUTTON $00000009
#
#const global GWL_STYLE $FFFFFFF0
#const global WS_TABSTOP $00010000
#const global WS_GROUP $00020000
#const global VK_SHIFT $00000010
//--------------------------------------
// ÎóµóÄê¿ô(¥ª¥Ö¥¸¥§¥¯¥ÈID)
//--------------------------------------
#enum RID_RADIO10=0
#enum RID_RADIO11
#enum RID_RADIO12
#enum RID_RADIO13
#enum RID_RADIO14
#
#enum RID_RADIO20
#enum RID_RADIO21
#enum RID_RADIO22
#
#enum RID_RADIO30
#enum RID_RADIO31
#enum RID_RADIO32
#enum RID_RADIO33
#
#enum MAX_CONTROL
//--------------------------------------
// ¥á¥¤¥óÉô
//--------------------------------------
*Init
n=0 ;ºî¶ÈÍÑÊÑ¿ô
nFocus=0 ;¥Õ¥©¡¼¥«¥¹(º£²ó)
nFocus2=0 ;¥Õ¥©¡¼¥«¥¹(Á°²ó)
nRadio1=0 ;¥°¥ë¡¼¥×¡
nRadio2=1 ;¥°¥ë¡¼¥×¢
nRadio3=3 ;¥°¥ë¡¼¥×£
*Main
screen 0,640,480,SCREEN_NORMAL|SCREEN_FIXEDSIZE
syscolor 15:boxf:color:title "¥é¥¸¥ª¥Ü¥¿¥ó¤Î¥°¥ë¡¼¥×²½(2) by ²Ê³ØÂÀϺ"
;ÇÛÃÖ(¥°¥ë¡¼¥×¡)
objsize 200,25
mes ""
repeat 5
button gosub strf("¥°¥ë¡¼¥×¡¡§¥é¥¸¥ª¥Ü¥¿¥ó(%d)",cnt+10), *RadioButton1
SetGroupTabStop objinfo_hwnd(stat)
loop
;ÇÛÃÖ(¥°¥ë¡¼¥×¢)
objsize 200,25
mes ""
repeat 3
button gosub strf("¥°¥ë¡¼¥×¢¡§¥é¥¸¥ª¥Ü¥¿¥ó(%d)",cnt+20), *RadioButton2
SetGroupTabStop objinfo_hwnd(stat)
loop
;ÇÛÃÖ(¥°¥ë¡¼¥×£)
objsize 200,25
mes ""
repeat 4
button gosub strf("¥°¥ë¡¼¥×£¡§¥é¥¸¥ª¥Ü¥¿¥ó(%d)",cnt+30), *RadioButton3
SetGroupTabStop objinfo_hwnd(stat)
loop
;½é´üÃÍ
SetRadioButton RID_RADIO10,RID_RADIO14,nRadio1
SetRadioButton RID_RADIO20,RID_RADIO22,nRadio2
SetRadioButton RID_RADIO30,RID_RADIO33,nRadio3
;ÀßÄê(¥Õ¥©¡¼¥«¥¹)
objsel(RID_RADIO10+nRadio1)
repeat
redraw 0
;¥¡¼Ä´ºº
stick n,$FFF
if(n & %0011):KeyMovePrev ;µÕÊý¸þ([¢«][¢¬]¥¡¼)
if(n & %1100):KeyMoveNext ;½çÊý¸þ([¢ª][¢]¥¡¼)
if(n & $0400):KeyTabStop ;¥¿¥Ö¥¹¥È¥Ã¥×([TAB]¥¡¼)
;¥Ç¥Ð¥Ã¥°¾ðÊó
DrawDebug
redraw 1
await 100
loop
stop
//--------------------------------------
// ¥°¥ë¡¼¥×¡¤ÎÁªÂò¼èÆÀ
//--------------------------------------
*RadioButton1
GetRadioButton RID_RADIO10,RID_RADIO14,nRadio1
return
//--------------------------------------
// ¥°¥ë¡¼¥×¢¤ÎÁªÂò¼èÆÀ
//--------------------------------------
*RadioButton2
GetRadioButton RID_RADIO20,RID_RADIO22,nRadio2
return
//--------------------------------------
// ¥°¥ë¡¼¥×£¤ÎÁªÂò¼èÆÀ
//--------------------------------------
*RadioButton3
GetRadioButton RID_RADIO30,RID_RADIO33,nRadio3
return
//--------------------------------------
// WS_GROUP¤ÈWS_TABSTOP¤òÀßÄê
//--------------------------------------
#deffunc SetGroupTabStop int _wnd_
SendMsg(_wnd_),BM_SETSTYLE,BS_AUTORADIOBUTTON,0
if(cnt==0){
GetWindowLong(_wnd_),GWL_STYLE
SetWindowLong(_wnd_),GWL_STYLE,stat|WS_GROUP|WS_TABSTOP
}
return
//--------------------------------------
// ¥é¥¸¥ª¥Ü¥¿¥ó¤Î¹àÌÜÈÖ¹æ¤òÀßÄê
//--------------------------------------
#deffunc SetRadioButton int _idFirst_,int _idLast_,int _no_
repeat((_idLast_)-(_idFirst_)+1),(_idFirst_)
SendMsg objinfo_hwnd(cnt),BM_SETCHECK,0,0
loop
SendMsg objinfo_hwnd(_idFirst_+_no_),BM_SETCHECK,1,0
return
//--------------------------------------
// ¥é¥¸¥ª¥Ü¥¿¥ó¤Î¹àÌÜÈÖ¹æ¤ò¼èÆÀ
//--------------------------------------
#deffunc GetRadioButton int _idFirst_,int _idLast_,var _no_
repeat((_idLast_)-(_idFirst_)+1),(_idFirst_)
SendMsg objinfo_hwnd(cnt),BM_GETCHECK,0,0
if(stat):_no_=(cnt)-(_idFirst_):break
loop
return(_no_)
//--------------------------------------
// [¢«][¢¬]¥¡¼¤Î°ÜÆ°½èÍý
//--------------------------------------
#deffunc KeyMovePrev
objsel -1:nFocus=stat
SendMsg objinfo_hwnd(nFocus),BM_SETCHECK,0,0
;¥Õ¥©¡¼¥«¥¹¤òÌá¤ë
GetWindowLong objinfo_hwnd(nFocus),GWL_STYLE
if(stat & WS_GROUP){
repeat
nFocus++:if(nFocus>=MAX_CONTROL):nFocus=0
GetWindowLong objinfo_hwnd(nFocus),GWL_STYLE
if(stat & WS_GROUP):break
loop
}
nFocus--:if(nFocus<0):nFocus=(MAX_CONTROL-1)
;¥Õ¥©¡¼¥«¥¹¤ÎÀßÄê
objsel nFocus
SendMsg objinfo_hwnd(nFocus),BM_SETCHECK,1,0
SendMsg objinfo_hwnd(nFocus),BM_CLICK,0,0
return
//--------------------------------------
// [¢ª][¢]¥¡¼¤Î°ÜÆ°½èÍý
//--------------------------------------
#deffunc KeyMoveNext
objsel -1:nFocus=stat
SendMsg objinfo_hwnd(nFocus),BM_SETCHECK,0,0
;¥Õ¥©¡¼¥«¥¹¤ò¿Ê¤à
nFocus++:if(nFocus>=MAX_CONTROL):nFocus=0
GetWindowLong objinfo_hwnd(nFocus),GWL_STYLE
if(stat & WS_GROUP){
repeat
nFocus--:if(nFocus<0):nFocus=(MAX_CONTROL-1)
GetWindowLong objinfo_hwnd(nFocus),GWL_STYLE
if(stat & WS_GROUP):break
loop
}
;¥Õ¥©¡¼¥«¥¹¤ÎÀßÄê
objsel nFocus
SendMsg objinfo_hwnd(nFocus),BM_SETCHECK,1,0
SendMsg objinfo_hwnd(nFocus),BM_CLICK,0,0
return
//--------------------------------------
// [TAB]¥¡¼¤Î°ÜÆ°½èÍý
//--------------------------------------
#deffunc KeyTabStop\
local szClass
dim szClass,1024
objsel -1:nFocus=stat
if(nFocus==nFocus2):return
;¥Ü¥¿¥ó¥¯¥é¥¹¤Î¥Á¥§¥Ã¥¯
GetClassName objinfo_hwnd(nFocus),varptr(szClass),1024
if(szClass!="1953789250"):return
;BS_AUTORADIOBUTTON¥¹¥¿¥¤¥ë
GetWindowLong objinfo_hwnd(nFocus),GWL_STYLE
if(stat & $000F)!=BS_AUTORADIOBUTTON:return
;½çÊý¸þ/µÕÊý¸þ
getkey n,VK_SHIFT
if(n){
;[SHIFT]¡Ü[TAB]¥¡¼
repeat
GetWindowLong objinfo_hwnd(nFocus),GWL_STYLE
if(stat & WS_TABSTOP):break
nFocus--:if(nFocus<0):nFocus=(MAX_CONTROL-1)
loop
}
else{
;[TAB]¥¡¼
repeat
GetWindowLong objinfo_hwnd(nFocus),GWL_STYLE
if(stat & WS_TABSTOP):break
nFocus++:if(nFocus>=MAX_CONTROL):nFocus=0
loop
}
;¥Õ¥©¡¼¥«¥¹¤ÎÀßÄê
objsel nFocus
return
//--------------------------------------
// ¥Ç¥Ð¥Ã¥°ÍѤΥ¹¥¿¥¤¥ë´Æ»ë
//--------------------------------------
#deffunc DrawDebug
syscolor 15:boxf:color
;¥¹¥¿¥¤¥ë¤Î´Æ»ë
pos 200,0
repeat MAX_CONTROL
GetWindowLong objinfo_hwnd(cnt),GWL_STYLE
if(stat & WS_GROUP):mes ""
mes strf("id%02d=$%08X",cnt,stat)
loop
;ÁªÂòÊÑ¿ô¤Î´Æ»ë
pos 400,0
mes ""
mes strf("nRadio1=%d",nRadio1)
mes strf("nRadio2=%d",nRadio2)
mes strf("nRadio3=%d",nRadio3)
return
//------------------------------------------------------------------------------
// End of sample196b(¥é¥¸¥ª¥Ü¥¿¥ó¤Î¥°¥ë¡¼¥×²½).hsp
//------------------------------------------------------------------------------
¤³¤ÎÊýË¡¤Ê¤é¤Ð¡¢½ã¿è¤ËHSP¤À¤±¤ÎÌ¿Îá¤Ç¤¹¤«¤é°ÂÁ´¤«¤È»×¤¤¤Þ¤¹¡£
| |
|