Esempio n. 1
0
void wxExFrame::OnUpdateUI(wxUpdateUIEvent& event)
{
    switch (event.GetId())
    {
#if wxUSE_STATUSBAR
    case ID_UPDATE_STATUS_BAR:
    {
        wxExSTC* stc = GetSTC();

        if (stc != NULL && stc->HasFocus())
        {
            UpdateStatusBar(stc, "PaneInfo");
            UpdateStatusBar(stc, "PaneLexer");
            UpdateStatusBar(stc, "PaneFileType");
        }
        else
        {
            wxExListView* lv = GetListView();

            if (lv != NULL && lv->HasFocus())
            {
                UpdateStatusBar(lv);
            }
        }
    }
    break;
#endif

    case ID_VIEW_MENUBAR:
        if (GetMenuBar() != NULL)
        {
            event.Check(GetMenuBar()->IsShown());
        }
        else
        {
            event.Check(false);
        }
        break;

#if wxUSE_STATUSBAR
    case ID_VIEW_STATUSBAR:
        if (GetStatusBar() != NULL)
        {
            event.Check(GetStatusBar()->IsShown());
        }
        else
        {
            event.Check(false);
        }
        break;
#endif

    default:
        wxFAIL;
        break;
    }
}
Esempio n. 2
0
void XSilChessWindow::MousePress(int x, int y)
{
	int i;
	SilChessMachine::Move m;

	RT.View2Board(x,y,&x,&y);
	if (x<0 || y<0 || x>7 || y>7 || (x==SelX && y==SelY)) {
		if (SelX!=-1 || SelY!=-1) {
			SelX=SelY=-1;
			UpdateView();
		}
		return;
	}
	i=Machine->GetField(x,y);
	if (i!=0 && ((i<7) == Machine->IsWhiteOn())) {
		if (SelX!=x || SelY!=y) {
			if (SelX==-1 || SelY==-1) {
				SelX=x;
				SelY=y;
				PaintSel();
			}
			else {
				SelX=x;
				SelY=y;
				UpdateView();
			}
		}
		return;
	}
	if (SelX!=-1 && SelY!=-1) {
		m.X1=SelX;
		m.Y1=SelY;
		m.X2=x;
		m.Y2=y;
		if (Machine->IsLegalMove(m)) {
			AbortSearching=true;
			HintWanted=false;
			HintValid=false;
			Machine->DoMove(m);
			SelX=SelY=-1;
			RT.SetWorld(Machine);
			UpdateStatusBar();
			UpdateMovesList();
			UpdateView();
		}
		else {
			SelX=SelY=-1;
			UpdateStatusBar();
			UpdateView();
		}
	}
}
bool C4EditCursor::LeftButtonUp(DWORD dwKeyState)
{
	// Finish edit/tool
	switch (Mode)
	{
		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	case C4CNS_ModeEdit:
		if (DragFrame) FrameSelection();
		if (DropTarget) PutContents();
		break;
		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	case C4CNS_ModeDraw:
		switch (Console.ToolsDlg.Tool)
		{
		case C4TLS_Line:
			if (DragLine) ApplyToolLine();
			break;
		case C4TLS_Rect:
			if (DragFrame) ApplyToolRect();
			break;
		}
		break;
		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	}

	// Release
	Hold=false;
	DragFrame=false;
	DragLine=false;
	DropTarget=NULL;
	// Update
	UpdateStatusBar();
	return true;
}
bool DISPLAY_FOOTPRINTS_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{
    bool eventHandled = true;

    // Filter out the 'fake' mouse motion after a keyboard movement
    if( !aHotKey && m_movingCursorWithKeyboard )
    {
        m_movingCursorWithKeyboard = false;
        return false;
    }

    wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
    cmd.SetEventObject( this );

    wxPoint pos = aPosition;
    wxPoint oldpos = GetCrossHairPosition();
    GeneralControlKeyMovement( aHotKey, &pos, true );

    switch( aHotKey )
    {
    case WXK_F1:
        cmd.SetId( ID_POPUP_ZOOM_IN );
        GetEventHandler()->ProcessEvent( cmd );
        break;

    case WXK_F2:
        cmd.SetId( ID_POPUP_ZOOM_OUT );
        GetEventHandler()->ProcessEvent( cmd );
        break;

    case WXK_F3:
        cmd.SetId( ID_ZOOM_REDRAW );
        GetEventHandler()->ProcessEvent( cmd );
        break;

    case WXK_F4:
        cmd.SetId( ID_POPUP_ZOOM_CENTER );
        GetEventHandler()->ProcessEvent( cmd );
        break;

    case WXK_HOME:
        cmd.SetId( ID_ZOOM_PAGE );
        GetEventHandler()->ProcessEvent( cmd );
        break;

    case ' ':
        GetScreen()->m_O_Curseur = GetCrossHairPosition();
        break;

    default:
        eventHandled = false;
    }

    SetCrossHairPosition( pos );
    RefreshCrossHair( oldpos, aPosition, aDC );

    UpdateStatusBar();    /* Display new cursor coordinates */

    return eventHandled;
}
Esempio n. 5
0
/*------------------------------------------------------------------------
Procedure:     MsgMenuSelect ID:1
Purpose:       Shows in the status bar a descriptive explaation of
the purpose of each menu item.The message
WM_MENUSELECT is sent when the user starts browsing
the menu for each menu item where the mouse passes.
Input:         Standard windows.
Output:        The string from the resources string table is shown
Errors:        If the string is not found nothing will be shown.
------------------------------------------------------------------------*/
LRESULT MsgMenuSelect(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
{
	static char szBuffer[256];
	UINT   nStringID = 0;
	UINT   fuFlags = GET_WM_MENUSELECT_FLAGS(wparam, lparam) & 0xffff;
	UINT   uCmd    = GET_WM_MENUSELECT_CMD(wparam, lparam);
	HMENU  hMenu   = GET_WM_MENUSELECT_HMENU(wparam, lparam);

	szBuffer[0] = 0;                            // First reset the buffer
	if (fuFlags == 0xffff && hMenu == NULL)     // Menu has been closed
		nStringID = 0;

	else if (fuFlags & MFT_SEPARATOR)           // Ignore separators
		nStringID = 0;

	else if (fuFlags & MF_POPUP)                // Popup menu
	{
		if (fuFlags & MF_SYSMENU)               // System menu
			nStringID = IDS_SYSMENU;
		else
			// Get string ID for popup menu from idPopup array.
			nStringID = 0;
	}  // for MF_POPUP
	else                                        // Must be a command item
		nStringID = uCmd;                       // String ID == Command ID

	// Load the string if we have an ID
	if (0 != nStringID)
		LoadString(hInst, nStringID, szBuffer, sizeof(szBuffer));
	// Finally... send the string to the status bar
	UpdateStatusBar(szBuffer, 0, 0);
	return 0;
}
Esempio n. 6
0
void ControlToolBar::OnPause(wxCommandEvent & WXUNUSED(evt))
{
   if (!CanStopAudioStream()) {
      return;
   }

#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
   if (gAudioIO->IsScrubbing())
      // Pausing does not make sense.  Force the button
      // to pop up below.
      mPaused = true;
#endif

   if(mPaused)
   {
      mPause->PopUp();
      mPaused=false;
   }
   else
   {
      mPause->PushDown();
      mPaused=true;
   }

   gAudioIO->SetPaused(mPaused);
   UpdateStatusBar(GetActiveProject());
}
/*!  Poll target to check run status
 *
 */
void GdbServerWindow::pollTarget() {
   static GdbTargetStatus lastTargetStatus = T_UNKNOWN;

   // Get status without polling target
   targetStatus = getGdbTargetStatus();
   switch (targetStatus) {
      case T_RUNNING:
      case T_SLEEPING:
         // Actually poll the target
         targetStatus = gdbPollTarget();
         // Set up next polling time
         statusTimer->Start(pollIntervalFast, wxTIMER_ONE_SHOT);
         break;
      case T_NOCONNECTION:
         Logging::print("GdbServerWindow::pollTarget() - T_NOCONNECTION\n");
         dropConnection();
         break;
      case T_UNKNOWN:
      case T_HALT:
         // Don't poll while not running
         break;
   }
   if (targetStatus != lastTargetStatus) {
      if (targetStatus == T_NOCONNECTION) {
         Logging::print("GdbServerWindow::pollTarget(), status changed to T_NOCONNECTION\n");
      }
      UpdateStatusBar();
   }
   lastTargetStatus = targetStatus;
}
/*!
 *  Drop client connection and clean up
 *
 */
void GdbServerWindow::dropConnection() {
   if (gdbInOut != NULL) {
      Logging::print("GdbServerWindow::dropConnection()\n");
      gdbInOut->finish();
      delete gdbInOut;
      gdbInOut = NULL;
   }
   if (statusTimer != NULL) {
      statusTimer->Stop();
      delete statusTimer;
      statusTimer = NULL;
   }
   shared->closeBdm();
   if (clientSocket != NULL) {
      clientSocket->Destroy();
      clientSocket = NULL;
      statusTextControl->AppendText(_(
            "\n=====================\n"
            "Dropped connection\n"));
      if (!deferredOpen && shared->isExitOnClose()) {
         statusTextControl->AppendText(_("Closing\n\n"));
         Close(true);
      }
   }
   serverState  = listening;
   clientAddr = _("None");
   targetStatus = T_UNKNOWN;
   UpdateStatusBar();
}
Esempio n. 9
0
void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
{
    if( m_zoomSelectBox == NULL )
        return;                        // Should not happen!

    int id = m_zoomSelectBox->GetCurrentSelection();

    if( id < 0 || !( id < (int)m_zoomSelectBox->GetCount() ) )
        return;

    if( id == 0 )                      // Auto zoom (Fit in Page)
    {
        Zoom_Automatique( true );
    }
    else
    {
        id--;
        double selectedZoom = GetScreen()->m_ZoomList[id];

        if( GetScreen()->GetZoom() == selectedZoom )
            return;

        GetScreen()->SetZoom( selectedZoom );
        RedrawScreen( GetScrollCenterPosition(), false );
    }

    // Notify GAL
    TOOL_MANAGER* mgr = GetToolManager();

    if( mgr && IsGalCanvasActive() )
    {
        mgr->RunAction( "common.Control.zoomPreset", true, id );
        UpdateStatusBar();
    }
}
Esempio n. 10
0
static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
{
	TWindowData *dat;

	HWND hwnd = M.FindWindow(wParam);
	if (hwnd != NULL) {
		dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
	}
	else {
		SESSION_INFO *si = SM_FindSessionByHCONTACT(wParam);
		if (si == NULL)
			return 1;
		
		dat = si->dat;
	}

	// delete old custom data
	if (dat->sbCustom) {
		delete dat->sbCustom;
		dat->sbCustom = NULL;
	}

	StatusTextData *st = (StatusTextData*)lParam;
	if (st != NULL && st->cbSize == sizeof(StatusTextData))
		dat->sbCustom = new StatusTextData(*st);

	UpdateStatusBar(dat);

	return 0;
}
Esempio n. 11
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    m_ui(new Ui::MainWindow),
    m_errorline(-1),
    m_isdebug(false),
    m_runline(-1),
    m_frame(0),
    m_rid(0)
{
    g_MainWindow = this;

    m_ui->setupUi(this);
    m_ui->dockWidget->setVisible(false);
    m_ui->dockWidget_2->setVisible(false);
    m_ui->dockWidget_3->setVisible(false);
    m_ui->dockWidget_4->setVisible(false);

    m_file_name.clear();
    m_ui->txtedit->setPlainText("");
    m_ui->txtedit->setVisible(true);
    m_saved.clear();

    m_ui->txtedit->setFont(QFont(tr("宋体"), 20, QFont::Normal));
    m_ui->txtedit->setLineWrapMode(QPlainTextEdit::NoWrap);
    highlightCurrentLine();

    m_ui->callstackview->setFont(QFont(tr("宋体"), 20, QFont::Normal));
    m_ui->callstackview->setSpacing(5);

    m_ui->routineview->setFont(QFont(tr("宋体"), 20, QFont::Normal));
    m_ui->routineview->setSpacing(5);

    m_ui->byteview->setFont(QFont(tr("宋体"), 10, QFont::Normal));
    m_ui->byteview->setLineWrapMode(QTextEdit::NoWrap);

    m_ui->memview->setFont(QFont(tr("宋体"), 10, QFont::Normal));
    m_ui->memview->setSpacing(5);

    new QSyntaxHighlighterFake(m_ui->txtedit->document());

    memset(m_argv, 0, sizeof(m_argv));

    m_fk = newfake();
    fkopenalllib(m_fk);
    fkseterrorfunc(m_fk, fk_error_func);
    fksetprintfunc(m_fk, fk_print_func);

    QFileInfo fi("sample.fk");
    if (fi.exists())
    {
        Openfile("sample.fk");
        UpdateStatusBar();
    }

    m_ui->callstackview->hide();
    m_ui->byteview->hide();
    m_ui->memview->hide();
    m_ui->routineview->hide();
    m_ui->horizontalLayout_2->removeItem(m_ui->verticalLayout);
}
Esempio n. 12
0
/*************
 * DESCRIPTION:	redraws the display
 * INPUT:			nMode		draw mode
 *						bChanged	display changed since editing began
 * OUTPUT:			-
 *************/
void CCamView::Redraw(int nMode, BOOL bChanged)
{
    UpdateStatusBar();

    bCanceled = TRUE;
    pDisplay->Redraw(nMode, bChanged);
}
bool FOOTPRINT_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{
    bool eventHandled = true;

    // Filter out the 'fake' mouse motion after a keyboard movement
    if( !aHotKey && m_movingCursorWithKeyboard )
    {
        m_movingCursorWithKeyboard = false;
        return false;
    }

    // when moving mouse, use the "magnetic" grid, unless the shift+ctrl keys is pressed
    // for next cursor position
    // ( shift or ctrl key down are PAN command with mouse wheel)
    bool snapToGrid = true;

    if( !aHotKey && wxGetKeyState( WXK_SHIFT ) && wxGetKeyState( WXK_CONTROL ) )
        snapToGrid = false;

    wxPoint oldpos = GetCrossHairPosition();
    wxPoint pos = aPosition;
    GeneralControlKeyMovement( aHotKey, &pos, snapToGrid );

    SetCrossHairPosition( pos, snapToGrid );
    RefreshCrossHair( oldpos, aPosition, aDC );

    if( aHotKey )
    {
        eventHandled = OnHotKey( aDC, aHotKey, aPosition );
    }

    UpdateStatusBar();

    return eventHandled;
}
Esempio n. 14
0
void ControlToolBar::OnPause(wxCommandEvent & WXUNUSED(evt))
{
   if (!CanStopAudioStream()) {
      return;
   }


   if(mPaused)
   {
      mPause->PopUp();
      mPaused=false;
   }
   else
   {
      mPause->PushDown();
      mPaused=true;
   }

#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
   if (gAudioIO->IsScrubbing())
      GetActiveProject()->GetScrubber().Pause(mPaused);
   else
#endif
   {
      gAudioIO->SetPaused(mPaused);
   }

   UpdateStatusBar(GetActiveProject());
}
Esempio n. 15
0
void ControlToolBar::OnStop(wxCommandEvent & WXUNUSED(evt))
{
   if (CanStopAudioStream()) {
      StopPlaying();
      UpdateStatusBar(GetActiveProject());
   }
}
Esempio n. 16
0
void
UpdateFrameComponents ( WindowObjectType *wo )
{

	int		X, Y;
	

	if ( QueryPointerPosition ( wo, &X, &Y ) ) {
	
	    SetCurrentX ( wo, X );
	    SetCurrentY ( wo, Y );
 	}

	UpdateTitleObject( wo );

	SetPixmapGeoMapping( wo );

	UpdateStatusBar( wo );

	UpdateFrameCounterWidgets ( wo );

	UpdateFrameButtons ( wo );

	UpdateFrameEditButtons ( wo );
	
	UpdateAnchorPoint ( wo );

}
Esempio n. 17
0
static void OnExitMenuLoop(HWND hWnd)
{
    bInMenuLoop = FALSE;
    /* Update the status bar pane sizes*/
    SetupStatusBar(hWnd, TRUE);
    UpdateStatusBar();
}
void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
{
    wxString msg;

    CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent();

    wxString footprintName = parentframe->m_footprintListBox->GetSelectedFootprint();

    if( !footprintName.IsEmpty() )
    {
        msg.Printf( _( "Footprint: %s" ), GetChars( footprintName ) );

        SetTitle( msg );
        const FOOTPRINT_INFO* module_info =
                parentframe->m_footprints.GetModuleInfo( footprintName );

        const wxChar* libname;

        if( module_info )
            libname = GetChars( module_info->GetNickname() );
        else
            libname = GetChars( wxT( "???" ) );

        msg.Printf( _( "Lib: %s" ), libname );

        SetStatusText( msg, 0 );

        if( GetBoard()->m_Modules.GetCount() )
        {
            // there is only one module in the list
            GetBoard()->m_Modules.DeleteAll();
        }

        MODULE* module = Get_Module( footprintName );

        if( module )
            GetBoard()->m_Modules.PushBack( module );

        Zoom_Automatique( false );
    }
    else   // No footprint to display. Erase old footprint, if any
    {
        if( GetBoard()->m_Modules.GetCount() )
        {
            GetBoard()->m_Modules.DeleteAll();
            Zoom_Automatique( false );
            SetStatusText( wxEmptyString, 0 );
        }
    }

    // Display new cursor coordinates and zoom value:
    UpdateStatusBar();

    GetCanvas()->Refresh();

    EDA_3D_FRAME* draw3DFrame = Get3DViewerFrame();

    if( draw3DFrame )
        draw3DFrame->NewDisplay();
}
Esempio n. 19
0
void VikeWin::GeneralHandler(int keyCode, bool skip)
{
    int state = GetState();

    if(state == VIKE_INVALID){
        ResetState();
        return;
    }

    /* Clear status on VIKE_END */
    if(state == VIKE_END){
        ClearKeyStatus();
        ResetState();
    }

    /* Not skip, update key status and status bar */
    if(!skip){
        if(state == VIKE_SEARCH || state == VIKE_COMMAND){
            ClearKeyStatus();
        }else if(state != VIKE_END){
            AppendKeyStatus(keyCode);
        }
        UpdateStatusBar();
    }
}
Esempio n. 20
0
/*-----------------------------------------------------------------*/
void __fastcall TDBWFRM::RangeAushebungClick(TObject *Sender)
{
    RangeAushebung->Checked = true;
    PopupRangeLiftout->Checked = true;
    currentrange = AUSHEBUNG;
    UpdateStatusBar();
}
Esempio n. 21
0
/*-----------------------------------------------------------------*/
void __fastcall TDBWFRM::RangeAbbindungClick(TObject *Sender)
{
    RangeAbbindung->Checked = true;
    PopupRangeUnbinding->Checked = true;
    currentrange = ABBINDUNG;
    UpdateStatusBar();
}
void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{
    if( GetScreen() == NULL )
        return;

    m_canvas->DrawBackGround( DC );

    RedrawComponent( DC, wxPoint( 0, 0 ) );

#ifdef USE_WX_OVERLAY
    if( IsShown() )
    {
        m_overlay.Reset();
        wxDCOverlay overlaydc( m_overlay, (wxWindowDC*)DC );
        overlaydc.Clear();
    }
#endif

    if( m_canvas->IsMouseCaptured() )
        m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );

    m_canvas->DrawCrossHair( DC );

    DisplayLibInfos();
    UpdateStatusBar();
}
Esempio n. 23
0
/*-----------------------------------------------------------------*/
void __fastcall TDBWFRM::Range9Click(TObject *Sender)
{
    Range9->Checked = true;
    PopupRange9->Checked = true;
    currentrange = 9;
    UpdateStatusBar();
}
/*
================
DialogDeclEditor::OnInitDialog
================
*/
BOOL DialogDeclEditor::OnInitDialog()
{

	com_editors |= EDITOR_DECL;

	CDialog::OnInitDialog();

	// load accelerator table
	m_hAccel = ::LoadAccelerators(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR_DECLEDITOR));

	// create status bar
	statusBar.CreateEx(SBARS_SIZEGRIP, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM, initialRect, this, AFX_IDW_STATUS_BAR);

	declEdit.Init();

	GetClientRect(initialRect);

	EnableToolTips(TRUE);

	testButton.EnableWindow(FALSE);
	okButton.EnableWindow(FALSE);

	UpdateStatusBar();

	return FALSE; // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 25
0
/*------------------------------------------------------------------------
 Procedure:     InitializeStatusBar ID:1
 Purpose:       Initialize the status bar
 Input:         hwndParent: the parent window
                nrOfParts: The status bar can contain more than one
                part. What is difficult, is to figure out how this
                should be drawn. So, for the time being only one is
                being used...
 Output:        The status bar is created
 Errors:
------------------------------------------------------------------------*/
void InitializeStatusBar(HWND hwndParent,int nrOfParts)
{
    const int cSpaceInBetween = 8;
    int   ptArray[40];   // Array defining the number of parts/sections
    RECT  rect;
    HDC   hDC;

   /* * Fill in the ptArray...  */

    hDC = GetDC(hwndParent);
    GetClientRect(hwndParent, &rect);

    ptArray[nrOfParts-1] = rect.right;
    //---TODO--- Add code to calculate the size of each part of the status
    // bar here.

    ReleaseDC(hwndParent, hDC);
    SendMessage(hWndStatusbar,
                SB_SETPARTS,
                nrOfParts,
                (LPARAM)(LPINT)ptArray);

    UpdateStatusBar("Ready", 0, 0);
    //---TODO--- Add code to update all fields of the status bar here.
    // As an example, look at the calls commented out below.

//    UpdateStatusBar("Cursor Pos:", 1, SBT_POPOUT);
//    UpdateStatusBar("Time:", 3, SBT_POPOUT);
}
Esempio n. 26
0
void PL_EDITOR_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition,
                                      int aHotKey )
{
    // Filter out the 'fake' mouse motion after a keyboard movement
    if( !aHotKey && m_movingCursorWithKeyboard )
    {
        m_movingCursorWithKeyboard = false;
        return;
    }

    wxPoint pos = aPosition;
    wxPoint oldpos = GetCrossHairPosition();
    GeneralControlKeyMovement( aHotKey, &pos, true );

    // Update cursor position.
    SetCrossHairPosition( pos, true );
    RefreshCrossHair( oldpos, aPosition, aDC );

    if( aHotKey )
    {
        OnHotKey( aDC, aHotKey, aPosition );
    }

    UpdateStatusBar();
}
Esempio n. 27
0
bool LIB_VIEW_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey )
{
    bool eventHandled = true;

    // Filter out the 'fake' mouse motion after a keyboard movement
    if( !aHotKey && m_movingCursorWithKeyboard )
    {
        m_movingCursorWithKeyboard = false;
        return false;
    }

    wxPoint pos = aPosition;
    GeneralControlKeyMovement( aHotKey, &pos, true );

    // Update cursor position.
    m_canvas->CrossHairOn( aDC );
    SetCrossHairPosition( pos, true );

    if( aHotKey )
    {
        SCH_SCREEN* screen = GetScreen();

        if( screen->GetCurItem() && screen->GetCurItem()->GetFlags() )
            eventHandled = OnHotKey( aDC, aHotKey, aPosition, screen->GetCurItem() );
        else
            eventHandled = OnHotKey( aDC, aHotKey, aPosition, NULL );
    }

    UpdateStatusBar();    // Display cursor coordinates info.

    return eventHandled;
}
/*
================
DialogScriptEditor::OnEnInputEdit
================
*/
void DialogScriptEditor::OnEnInputEdit( NMHDR *pNMHDR, LRESULT *pResult ) {
	MSGFILTER *msgFilter = ( MSGFILTER * )pNMHDR;
	if( msgFilter->msg != 512 && msgFilter->msg != 33 ) {
		UpdateStatusBar();
	}
	*pResult = 0;
}
/*
================
DialogEntityDefEditor::LoadDecl
================
*/
void DialogEntityDefEditor::LoadDecl( idDeclEntityDef *decl ) {
	int numLines = 0;
	CRect rect;
	this->decl = decl;
	// Fill up the spawnclass box with all spawn classes
	/*
	idTypeInfo *c = idClass::GetClass("idClass");
	for (; c; c = c->next) {
		spawnclassCombo.AddString(c->classname);
	}
	*/
	// Fill up the inherit box with all entitydefs
	int numDecls = declManager->GetNumDecls( DECL_ENTITYDEF );
	for( int i = 0; i < numDecls; i++ ) {
		const idDecl *d = declManager->DeclByIndex( DECL_ENTITYDEF, i, false );
		if( d ) {
			inheritCombo.AddString( d->GetName() );
		}
	}
	firstLine = decl->GetLineNum();
	char *declText = ( char * )_alloca( ( decl->GetTextLength() + 1 ) * sizeof( char ) );
	decl->GetText( declText );
	PopulateLists( declText );
	SetWindowText( va( "EntityDef Editor (%s, line %d)", decl->GetFileName(), decl->GetLineNum() ) );
	// Hack to get it to reflow the window
	GetWindowRect( rect );
	rect.bottom++;
	MoveWindow( rect );
	testButton.EnableWindow( FALSE );
	okButton.EnableWindow( FALSE );
	UpdateStatusBar();
}
Esempio n. 30
0
//UINT WINAPI AcceptThread(LPVOID lpParameter)
DWORD WINAPI AcceptThread(LPVOID lpParameter)
{
	int							nLen = sizeof(SOCKADDR_IN);
	char						szMsg[64];

	SOCKET						Accept;
	SOCKADDR_IN					Address;

	while (TRUE)
	{
		Accept = accept(g_ssock, (struct sockaddr FAR *)&Address, &nLen);

		if (g_fTerminated)
			return 0;

		CSessionInfo* pNewUserInfo = (CSessionInfo*)GlobalAlloc(GPTR, sizeof(CSessionInfo));

		if (pNewUserInfo)
		{
			pNewUserInfo->sock				= Accept;

			CreateIoCompletionPort((HANDLE)pNewUserInfo->sock, g_hIOCP, (DWORD)pNewUserInfo, 0);

			if (g_xSessionList.AddNewNode(pNewUserInfo))
			{
				int zero = 0;
				
				setsockopt(pNewUserInfo->sock, SOL_SOCKET, SO_SNDBUF, (char *)&zero, sizeof(zero) );

				// ORZ:
				pNewUserInfo->Recv();

				UpdateStatusBar(TRUE);

				szMsg[0] = '%';
				szMsg[1] = 'O';

				char *pszPos = ValToAnsiStr((int)Accept, &szMsg[2]);
				
				*pszPos++ = '/';

				pszPos = ValToAnsiStr((int)Address.sin_addr.s_net, pszPos);
				*pszPos++ = '.';
				pszPos = ValToAnsiStr((int)Address.sin_addr.s_host, pszPos);
				*pszPos++ = '.';
				pszPos = ValToAnsiStr((int)Address.sin_addr.s_lh, pszPos);
				*pszPos++ = '.';
				pszPos = ValToAnsiStr((int)Address.sin_addr.s_impno, pszPos);

				*pszPos++	= '$';
				*pszPos		= '\0';

				SendExToServer(szMsg);
			}
		}
	}

	return 0;
}