Ejemplo n.º 1
0
//---------------------------------------------------------------------------
void __fastcall TLogListDlg::KOpenClick(TObject *Sender)
{
#if 1
	MainVARI->KFLOClick(NULL);
	UpdateLogCount(1);
#else
	OpenDialog->Options >> ofCreatePrompt;
	OpenDialog->Options >> ofFileMustExist;
	if(MsgEng){
		OpenDialog->Title = "Open LogData File";
		OpenDialog->Filter = "MMLOG Data File(*.mdt)|*.mdt|";
	}
	else {
		OpenDialog->Title = "ログファイルのオープン";
		OpenDialog->Filter = "MMLOG Data File(*.mdt)|*.mdt|";
	}
	OpenDialog->FileName = "";
	OpenDialog->DefaultExt = "mdt";
	OpenDialog->InitialDir = MMLogDir;
	NormalWindow(this);
	if( OpenDialog->Execute() == TRUE ){
		Log.Close();
		Log.MakeName(OpenDialog->FileName.c_str());
		Log.Open(NULL, TRUE);
		UpdateLogCount(1);
	}
	TopWindow(this);
#endif
}
Ejemplo n.º 2
0
//---------------------------------------------------------------------------
void __fastcall TRADIOSetDlg::LoadBtnClick(TObject *Sender)
{
//
	TOpenDialog *pBox = MmttyWd->OpenDialog;
	pBox->Options >> ofCreatePrompt;
	pBox->Options << ofFileMustExist;
	if(Font->Charset != SHIFTJIS_CHARSET){
		pBox->Title = "Open command file";
		pBox->Filter = "Command files(*.rcm)|*.rcm|";
	}
	else {
		pBox->Title = "コマンド定義ファイルを開く";
		pBox->Filter = "コマンド定義ファイル(*.rcm)|*.rcm|";
	}
	pBox->FileName = "";
	pBox->DefaultExt = "rcm";
	pBox->InitialDir = BgnDir;
	NormalWindow(this);
	if( pBox->Execute() == TRUE ){
		CWaitCursor w;
		TMemIniFile *pIniFile = new TMemIniFile(pBox->FileName);
		CmdInit->Text = pIniFile->ReadString("RADIO", "CmdInit", CmdInit->Text);
		CmdRx->Text = pIniFile->ReadString("RADIO", "CmdRx", CmdRx->Text);
		CmdTx->Text = pIniFile->ReadString("RADIO", "CmdTx", CmdTx->Text);
		Cmdxx->Text = pIniFile->ReadString("RADIO", "Cmdxx", Cmdxx->Text);
		m_PollType = pIniFile->ReadInteger("RADIO", "PollType", 0);
		FreqOffset->ItemIndex = pIniFile->ReadInteger("RADIO", "PollOffset", 5);
		PollInt->Text = (pIniFile->ReadInteger("RADIO", "PollInterval", 0) + 5)/10.0;
		AddrScan->Checked = 0;
		delete pIniFile;
		SetMaker();
		UpdateUI();
	}
	TopWindow(this);
}
Ejemplo n.º 3
0
//---------------------------------------------------------------------------
int __fastcall TFileViewDlg::NewFolder(void)
{
	int r = FALSE;

	TOpenDialog *pDialog = Mmsstv->OpenDialog;
	pDialog->Options >> ofCreatePrompt;
	pDialog->Options >> ofFileMustExist;
	if( MsgEng ){
		pDialog->Title = "Set folder";
	}
	else {
		pDialog->Title = "フォルダの選択";
	}
	char bf[512];
	sprintf(bf, "%s|%s|%s|%s", GetPicFilter(), GetTempFilter(), GetLibFilter(), "OLE objects(*.*)|*.*");
	pDialog->Filter = bf;
	pDialog->FileName = "Dummy";
	pDialog->DefaultExt = "jpg";
	pDialog->InitialDir = pCurPage->m_Folder.c_str();
	pDialog->FilterIndex = pCurPage->m_Type + 1;
	SetDisPaint();
	NormalWindow(Mmsstv);
	if( Mmsstv->OpenDialogExecute(TRUE) == TRUE ){
		SetDirName(bf, AnsiString(pDialog->FileName).c_str());	//ja7ude 0428
		pCurPage->m_Folder = bf;
		char drive[_MAX_DRIVE];
		char dir[_MAX_DIR];
		char name[_MAX_FNAME];
		char ext[_MAX_EXT];
		AnsiString	Name;
		::_splitpath( AnsiString(pDialog->FileName).c_str(), drive, dir, name, ext );
		m_Name = name;
		m_Name += ext;
#if 1
		pCurPage->m_Type = pDialog->FilterIndex - 1;
#else
		LPCSTR pExt = GetEXT(m_Name.c_str());
		if( !strcmpi(pExt, "MTI") ){
			pCurPage->m_Type = 2;
		}
		else if( !strcmpi(pExt, "MTM") ){
			pCurPage->m_Type = 1;
		}
		else if( !strcmpi(pExt, "DLL") ){
			pCurPage->m_Type = 3;
		}
		else if( IsPic(pExt) ){
			pCurPage->m_Type = 0;
		}
		else {
			pCurPage->m_Type = 4;
		}
#endif
		r = TRUE;
	}
	ResDisPaint();
	TopWindow(Mmsstv);
	return r;
}
Ejemplo n.º 4
0
//---------------------------------------------------------------------------
void __fastcall TColorBarDlg::BitBtnClick(TObject *Sender)
{
	TOpenDialog *pDialog = Mmsstv->OpenDialog;
	pDialog->Options >> ofCreatePrompt;
	pDialog->Options << ofFileMustExist;
	if( MsgEng ){
		pDialog->Title = "Load picture from file";
	}
	else {
		pDialog->Title = "画像のロード";
	}
	pDialog->Filter = GetPicFilter();
	pDialog->FileName = "";
	pDialog->DefaultExt = "jpg";
	pDialog->InitialDir = BitmapDir;
	SetDisPaint();
	NormalWindow(this);
	if( Mmsstv->OpenDialogExecute(TRUE) == TRUE ){
		SetDirName(BitmapDir, AnsiString(pDialog->FileName).c_str());	//ja7ude 0428
		TPicRectDlg *pBox = new TPicRectDlg(this);
		if( ::LoadImage(pBox->pBitmap, AnsiString(pDialog->FileName).c_str()) == TRUE ){	//ja7ude 0428
			Graphics::TBitmap *pBmp = new Graphics::TBitmap();
			AdjustBitmapFormat(pBmp);
			pBmp->Width = pBox->pBitmap->Width < 320 ? pBox->pBitmap->Width : 320;
			int H = 16;
			int d;
			if( sscanf(AnsiString(LineCnt->Text).c_str(), "%u", &d) == 1 ){	//ja7ude 0428
				if( (d >= 1) && (d <= 256) ){
					H = d;
				}
			}
			pBmp->Height = pBox->pBitmap->Height < H ? pBox->pBitmap->Height : H;
			if( pBox->Execute(pBmp) == TRUE ){
				if( pBitmap == NULL ){
					pBitmap = new Graphics::TBitmap();
				}
				AdjustBitmapFormat(pBitmap);
				pBitmap->Width = 320;
				pBitmap->Height = H;
				int x, y;
				for( y = 0; y < pBitmap->Height; y += pBmp->Height){
					for( x = 0; x < pBitmap->Width; x += pBmp->Width){
						pBitmap->Canvas->Draw(x, y, pBmp);
					}
				}
			}
			delete pBmp;
		}
		delete pBox;
	}
	ResDisPaint();
	TopWindow(this);
}
Ejemplo n.º 5
0
//---------------------------------------------------------------------------
void __fastcall TRADIOSetDlg::SaveBtnClick(TObject *Sender)
{
	TSaveDialog *pBox = MmttyWd->SaveDialog;
	if( (Font->Charset != SHIFTJIS_CHARSET) ){
		pBox->Title = "Save command file";
		pBox->Filter = "Command files(*.rcm)|*.rcm|";
	}
	else {
		pBox->Title = "コマンド定義ファイルの作成";
		pBox->Filter = "コマンド定義ファイル(*.rcm)|*.rcm|";
	}
	pBox->FileName = "MyRIG.rcm";
	pBox->DefaultExt = "rcm";
	pBox->InitialDir = BgnDir;
	NormalWindow(this);
	if( pBox->Execute() == TRUE ){
		CWaitCursor w;
		TMemIniFile *pIniFile = new TMemIniFile(pBox->FileName);
		pIniFile->WriteString("RADIO", "CmdInit", CmdInit->Text);
		pIniFile->WriteString("RADIO", "CmdRx", CmdRx->Text);
		pIniFile->WriteString("RADIO", "CmdTx", CmdTx->Text);
		pIniFile->WriteString("RADIO", "Cmdxx", Cmdxx->Text);
		pIniFile->WriteInteger("RADIO", "PollType", m_PollType);
		pIniFile->WriteInteger("RADIO", "PollOffset", FreqOffset->ItemIndex);
		double d;
		int dd = 5;
		if( sscanf(AnsiString(PollInt->Text).c_str(), "%lf", &d) == 1 ){	//JA7UDE 0428
			if( d >= 0.5 ){
				dd = int((d * 10.0) - 5);
				if( dd < 0 ) dd = 0;
			}
		}
		pIniFile->WriteInteger("RADIO", "PollInterval", dd);
		pIniFile->UpdateFile();
		delete pIniFile;
	}
	TopWindow(this);
}
Ejemplo n.º 6
0
//---------------------------------------------------------------------------
void __fastcall TRADIOSetDlg::RefBtnClick(TObject *Sender)
{
	TOpenDialog *pBox = Mmsstv->OpenDialog;
	pBox->Options >> ofCreatePrompt;
	pBox->Options << ofFileMustExist;
	if( MsgEng ){
		pBox->Title = "Program file";
		pBox->Filter = "Program files(*.exe;*.lnk)|*.exe;*.lnk|";
	}
	else {
		pBox->Title = "プログラムファイル";
		pBox->Filter = "プログラムファイル(*.exe;*.lnk)|*.exe;*.lnk|";
	}
	pBox->FileName = CmdGNR->Text.c_str();
	pBox->DefaultExt = "exe";
	char bf[256];
	SetDirName(bf, AnsiString(CmdGNR->Text).c_str());	//ja7ude 0428
	pBox->InitialDir = bf;
	NormalWindow(this);
	if( pBox->Execute() == TRUE ){
		CmdGNR->Text = pBox->FileName.c_str();
	}
	TopWindow(this);
}
Ejemplo n.º 7
0
#ifndef previewframe_ex_hpp
#define previewframe_ex_hpp

#include "config.hpp"

#include "wx_utility.hpp"

#include <wx/prntbase.h>

class PreviewFrameEx
    :public wxPreviewFrame
{
public:
    PreviewFrameEx
    (wxPrintPreviewBase* preview
     ,wxFrame*            parent = dynamic_cast<wxFrame*>(&TopWindow())
                                   ,wxString     const& title  = "Print preview"
                                           ,wxPoint      const& pos    = wxDefaultPosition
                                                   ,wxSize       const& size   = TopWindow().GetSize()
                                                           ,long int            style  = wxDEFAULT_FRAME_STYLE | wxFULL_REPAINT_ON_RESIZE
                                                                   ,wxString     const& name   = "Loading print preview..."
    );
    virtual ~PreviewFrameEx();

    // wxPreviewFrame overrides.
    virtual void Initialize();

private:
    // WX !! Should OnCloseWindow() be virtual in the base class?
    void UponCloseWindow(wxCloseEvent& event);
Ejemplo n.º 8
0
AUI_ERRCODE aui_UI::HandleKeyboardEvents( void )
{
//	AUI_ERRCODE errcode = AUI_ERRCODE_UNHANDLED;







	
	m_keyboard->GetInput();

	
	
	
	return AUI_ERRCODE_OK;

#if 0   // Unreachable	
	aui_Control *control = aui_Control::GetKeyboardFocus();

	
	for ( sint32 k = 1; k; k-- )
	{
		aui_KeyboardEvent *event = m_keyboard->GetLatestKeyboardEvent();

		if ( control )
			errcode = control->HandleKeyboardEvent( event );

		
		if ( m_childListChanged )
		{
			
			
			m_childListChanged = FALSE;
			return errcode;
		}

		
		if ( event->key == AUI_KEYBOARD_KEY_TAB )
		{
			static bool wasJustDown = false;

			if ( !event->down )
			{
				wasJustDown = false;
			}
			else if ( !wasJustDown )
			{
				tech_WLList<aui_Region *> *siblings;

				if ( control ) m_virtualFocus = control;

				if ( m_virtualFocus )
				{
					siblings = m_virtualFocus->GetParent()->ChildList();
					ListPos position = siblings->Find( m_virtualFocus );

					siblings->GetNext( position );

					
					
					if ( position )
						m_virtualFocus = (aui_Control *)siblings->GetNext( position );
					else
						m_virtualFocus = (aui_Control *)siblings->GetHead();
				}
				else if ( m_childList->L() )
				{
					siblings = TopWindow()->ChildList();
					if ( siblings->L() )
						m_virtualFocus = (aui_Control*)siblings->GetHead();
				}

				if ( m_virtualFocus )
					m_virtualFocus->SetKeyboardFocus();

				wasJustDown = true;
			}
		}
	}

	return errcode;
#endif
}
Ejemplo n.º 9
0
void PreviewFrameEx::UponCloseWindow(wxCloseEvent& event)
{
    TopWindow().Show(true);
    event.Skip();
}
Ejemplo n.º 10
0
void PreviewFrameEx::Initialize()
{
    wxPreviewFrame::Initialize();
    TopWindow().Show(false);
}
Ejemplo n.º 11
0
int main(int argc,char *argv[])
{


    timers timer;
    int lflag=0;
    int		num;
    int i;//cnum繰り返すため
    char	name[MAX_CLIENTS][MAX_NAME_SIZE];
    char	localHostName[]="localhost";
    char	*serverName;
    char	data[MAX_DATA];
    //int		clientID;

//    SDL_TimerID timer_id1;	// タイマ割り込みを行うためのタイマのID

    // SDL初期化
    if(SDL_Init(SDL_INIT_EVERYTHING) < 0) {
        printf("failed to initialize SDL.\n");
        exit(-1);
    }

    /* 引き数チェック */
    if(argc == 2){
    	serverName = localHostName;
        if (wiimote_connect(&wiimote, argv[1]) < 0) {	// コマンド引数に指定したWiiリモコン識別情報を渡して接続
            printf("unable to open wiimote: %s\n", wiimote_get_error());
            exit(1);
    }
    }
    else if(argc == 3){
    	serverName = argv[1];
        if (wiimote_connect(&wiimote, argv[2]) < 0) {	// コマンド引数に指定したWiiリモコン識別情報を渡して接続
            printf("unable to open wiimote: %s\n", wiimote_get_error());
            exit(1);
    }
    }
    else{
		fprintf(stderr, "Usage: %s, Cannot find a Server Name.\n", argv[0]);
		return -1;
    }

    /* サーバーとの接続 */
    if(SetUpClient(serverName,&clientID,name)==-1){
		fprintf(stderr,"setup failed : SetUpClient\n");
		return -1;
	}

    printf("clientnum=%d\n",cnum);

    /* スタート画面の初期化 */
    /*if(InitWindows()==-1){
		fprintf(stderr,"setup failed : InitWindows\n");
		return -1;
                }*/
    
   /*ゲームウィンドウの初期化*/
    /*  if(GameWindows(clientID,name,loop)==-1){
	fprintf(stderr,"setup failed : GameWindows\n");
		return -1;

                }*/

        printf("clientnum=%d\n",cnum);

        wiimote.mode.acc = 1;

        switch(clientID){
        case 0: wiimote.led.one =   1; break;
        case 1: wiimote.led.two   = 1; break; 
        case 2 :wiimote.led.three = 1; break;

        default: break;
        }

    /*wiiリモコンの入力受付開始*/

    // SDL_GetTicks関数を用いる時間管理
	Uint32 next_frame=SDL_GetTicks();	// SDLライブラリの初期化からの経過ミリ秒数を取得
        
        //dflag = 0;
        game.flag = 0;
        thr_net=SDL_CreateThread(thread_net,NULL);
        //thr_time=SDL_CreateThread(thread_time,NULL);
        timer_id1=SDL_AddTimer(100, callbackfunc, NULL);
    /* メインイベントループ */
    while(endFlag){
/*
        timer.now=SDL_GetTicks();//現在時間を取得
        timer.wit=timer.now-timer.lev;//待ち時間を計算

        if(dflag == 0)
        {
            WindowEvent(clientID);
            //timer.lev=SDL_GetTicks();//経過時間を更新
        }
        else if(timer.wit > 16){
            WindowEvent(clientID);
            dflag = 0;
            timer.lev=SDL_GetTicks();//経過時間を更新
        }
*/
        timer.wit=timer.now-timer.lev;//待ち時間を計算

        /*if(timer.wit > 1000){
            game.restTime--;
            timer.lev=SDL_GetTicks();//経過時間を更新
            }*/


        /********メイン画面ループ**************/
        if(game.flag == 0){
            loop=1;
            gametimes=3;
            TopWindow();
            printf("now==%d\n\n",game.flag);
            while(game.flag == 0){
                WindowEvent(clientID,ima);
                if(endFlag == 0)
                    break;
            }
        }
        else if(game.flag == 1){//ゲーム画面作成
            
            if(GameWindows(clientID,name,loop)==-1){
                fprintf(stderr,"setup failed : GameWindows\n");
		return -1;}
        }
        /*********ゲーム画面ループ************/
        else if(game.restTime > 0 && game.flag == 2){
            WindowEvent(clientID,ima);  
            ima=SDL_GetTicks();//現在時間を取得
            //printf("game.restTime:%d\n",game.restTime);
//>>>>>>> color
            DrawChara(clientID,cnum);
        }
        
        else if(game.flag == 3 || game.restTime <= 0)
        {
            game.flag = 3;
            if(gClients[clientID].ADsta==1 && game.restTime<=0){
                gClients[clientID].score -= gClients[clientID].Bflag;
                sprintf(data,"kabaddi,%d,%d,%d,%d,%d,%d,%d,%d\0",SCORE,clientID,gClients[clientID].score,0,0,0,0,0);
                SendData(data);
                }
            WinDisplay(clientID);
            
            printf("now==%dloop==%dcnum==%dgametimes=%d\n\n",game.flag,loop,cnum,gametimes);
            while(game.flag == 3){
                WindowEvent(clientID,ima);
                if(endFlag == 0)
                    break;
            }
        }
        else if(game.flag == 4){
            //loop=0;
            EndWindow();
            for(i=0;i<cnum;i++){
                gClients[i].score=0;
                //gClients[i].restart=0;
                // gametimes=3;
            }
            while(game.flag == 4){
                WindowEvent(clientID,ima);
                if(endFlag == 0)
                    break;
            }    
            
        }
        
        timer.lev=SDL_GetTicks();//経過時間を更新
        
        
        
        
        // timer.now=SDL_GetTicks();//現在時間を取得
        //timer.wit=timer.now-timer.lev;//待ち時間を計算
        
        // if(timer.wit<16)
            //    SDL_Delay(16-timer.wit);//16以下ならCPUを休ませる
        
        //timer.lev=SDL_GetTicks();//経過時間を更新
        
    }
    
    /* 終了処理 */
    SDL_RemoveTimer(timer_id1);
    DestroyWindow();
    CloseSoc();
    
    return 0;
}