示例#1
0
BOOL CAIThread::InitInstance()
{
	SetClient( m_pBotDoc );
	SetGameState( m_pBotDoc );
	m_aiGameData.ReadDataFile("gamedata.txt");
	m_pDoMove = &CAIThread::NormalMove;
	return TRUE;
}
示例#2
0
//---------------------------------------------------------------------------
void __fastcall TFormClientRep::SelectClient()
{
	AnsiString Params = IntToStr(DModT->CurEmpID) + ",'" + DModT->ComputerName + "'";
	int ID = ClientID;
	AnsiString SelectResultStr;
	if (SimpleSelEhClientID(this,0,ID,&SelectResultStr)) {
		SetClient(ID, GetPiece(SelectResultStr,"/",1));
	}
}
示例#3
0
//---------------------------------------------------------------------------
void __fastcall TFormClientRep::FormCreate(TObject *Sender)
{
	sPageControl1->ActivePage = sTabSheet1;
	InitCommon();
	InitGData();
	SetPage();
	if (!ClientID)
	  SelectClient();
	else SetClient(ClientID,ClientName);

}
ToolBarParent :: ToolBarParent(const XResource * r, const XRect& rec, XToolBar * t):XFrameWindow(r, "", FRM_TITLEBAR | FRM_BORDER | FRM_SYSMENU | WIN_VISIBLE, rec)
{
   t->cutWindow = this;

   init = TRUE;
   toolBar = t;
   WinSetParent(t->GetHandle(), frameWin->GetHandle(), TRUE);
   WinSetOwner(frame, t->frame->frame);
   SetClient(t);
/******************************
 ULONG Frame_style = WinQueryWindowULong( frame, QWL_STYLE );
 Frame_style = ( Frame_style & ~FS_BORDER ) | FS_SIZEBORDER;
 WinSetWindowULong( frame, QWL_STYLE, Frame_style );
 WinSendMsg( frame, WM_UPDATEFRAME, MPFROMP( FCF_BORDER ), 0 );
********************************/
   Activate();
   SetText(t->title);
   init = FALSE;
}
示例#5
0
struct Client *make_local_person_full(const char *nick, const char *username, const char *hostname, const char *ip, const char *realname)
{
	struct Client *client;

	client = make_client(NULL);
	rb_dlinkMoveNode(&client->localClient->tnode, &unknown_list, &lclient_list);
	client->servptr = &me;
	rb_dlinkAdd(client, &client->lnode, &client->servptr->serv->users);
	make_user(client);
	SetClient(client);

	rb_inet_pton_sock(ip, (struct sockaddr *)&client->localClient->ip);
	rb_strlcpy(client->name, nick, sizeof(client->name));
	rb_strlcpy(client->username, username, sizeof(client->username));
	rb_strlcpy(client->host, hostname, sizeof(client->host));
	rb_inet_ntop_sock((struct sockaddr *)&client->localClient->ip, client->sockhost, sizeof(client->sockhost));
	rb_strlcpy(client->info, realname, sizeof(client->info));

	add_to_client_hash(client->name, client);

	return client;
}
/* here the mainwindow will be created */
MyAppWindow :: MyAppWindow( ULONG id ): XFrameWindow( id, "Sample1", XFrameWindow::defaultStyle | FRM_ICON | FRM_TASKLIST)
{

   loading = FALSE;

   XRect rec( 100, 100, 500, 350);
   SetSize( &rec );
   /* we create a MLE-control; because the MLE is used as client we dont want a border */
   /* and donït use the defaults (see <xmle.h>) */
   mle = new MyMLE( this );

   /*set backgroundcolor to white*/
   XColor col( COL_WHITE);
   mle->SetBackgroundColor( &col );

   /* the MLE is used as a new client-area, so sizing and moving is automaticaly done */
   SetClient( mle );

   /* we want a menubar, it is defined in the resources of the exe-file with the id IDM_MAIN */
   menu = new XMenuBar( this, IDM_MAIN);

   /* we put a string into the MLE */
   mle->SetText( "this is our MLE where you can edit your text...");

   /*we generate our drag-handler and attach it to the MLE */
   MyDragHandler * myDragHandler = new MyDragHandler( mle );

   /* setup our needed flags */
   saved = TRUE;
   loaded = FALSE;

   dlg = NULL;

   /*the mle gets the focus */
   mle->SetFocus();
}