コード例 #1
0
ファイル: app.c プロジェクト: RorschachUK/Trakr
void Start()
{
	OpenFileSystem();
	OpenGraphics();
	OpenMotors();
	OpenIR();
	//Register images
	OpenImageRegister();
	logoImage = RegisterImage(_binary_Images_bigtrakr_bmp_start,_binary_Images_bigtrakr_bmp_end - _binary_Images_bigtrakr_bmp_start);
	signatureImage = RegisterImage(_binary_Images_rorschach_bmp_start,_binary_Images_rorschach_bmp_end - _binary_Images_rorschach_bmp_start);
	upImage = RegisterImage(_binary_Images_up_bmp_start,_binary_Images_up_bmp_end - _binary_Images_up_bmp_start);
	downImage = RegisterImage(_binary_Images_down_bmp_start,_binary_Images_down_bmp_end - _binary_Images_down_bmp_start);
	markerImage = RegisterImage(_binary_Images_marker_bmp_start,_binary_Images_marker_bmp_end - _binary_Images_marker_bmp_start);
	CloseImageRegister();

  	steps=0;
  	menuItem=1;
  	menuNum = 1;
  	mode=1;	//menu
  	IRState=false;
  	rotateSleep = ROTATESLEEP;
  	LoadCalibration();
  	white=RGBColor(255,255,255,0);
	green=RGBColor(0,255,0,0);
	red=RGBColor(255,0,0,0);
	blue=RGBColor(0,0,255,0);
	black=RGBColor(0,0,0,0);
	grey=RGBColor(128,128,128,0);
  	//Splash
	Splash();
	Sleep( 2000 );
	ClearScreen();
	Show();
}
コード例 #2
0
ファイル: app.c プロジェクト: RorschachUK/Trakr
//Setup
void Start() {
	OpenFileSystem();
	OpenGraphics();
	SetLineWidth(1); //needed otherwise we draw huge thick points!

	//Register bitmaps
	OpenImageRegister();
	logoImage = RegisterImage(_binary_Images_battle_bmp_start,_binary_Images_battle_bmp_end - _binary_Images_battle_bmp_start);
	signatureImage = RegisterImage(_binary_Images_rorschach_bmp_start,_binary_Images_rorschach_bmp_end - _binary_Images_rorschach_bmp_start);
	tankImage = RegisterImage(_binary_Images_tank_bmp_start,_binary_Images_tank_bmp_end - _binary_Images_tank_bmp_start);
	CloseImageRegister();

	sweepStepCount=0;

	ResetTimer();
	arrowRefAngle=0;
	sweepAngle = 2 * PI / SWEEPSTEPS;

	arrowX=20;
	arrowY=20;
	radarX=140;
	radarY=20;

	sweepArm.x=140;
	sweepArm.y=20;
	oldKeystate=0;

	refreshCount=0;

  	//Load calibration data, if any exists
  	rotateSleep = ROTATESLEEP;
  	LoadCalibration();

	Splash();
}
コード例 #3
0
ファイル: CodeEdit.cpp プロジェクト: Halfbrick/decoda
void CodeEdit::SetDefaultLexer()
{
    SetLexer(wxSTC_LEX_NULL);

    SetKeyWords(1, "");

    // Set the caret width to match MSVC.
    SetCaretWidth(2);

    // Set the marker bitmaps.
    MarkerDefineBitmap(Marker_Breakpoint,  wxMEMORY_BITMAP(Breakpoint_png) );
    MarkerDefineBitmap(Marker_CurrentLine, wxMEMORY_BITMAP(Currentline_png) );
    MarkerDefineBitmap(Marker_BreakLine,   wxMEMORY_BITMAP(Breakline_png) );

    // Setup the dwell time before a tooltip is displayed.
    SetMouseDwellTime(300);

    SetMarginSensitive(1, true);
    SetMarginType(1, wxSTC_MARGIN_SYMBOL);

    // Set the autocomplete icons.

    wxColour maskColor(0xFF, 0x9B, 0x77);

    wxBitmap functionIcon(functionicon, wxBITMAP_TYPE_XPM);
    functionIcon.SetMask(new wxMask(functionicon, maskColor));
    
    RegisterImage(AutoCompleteManager::Type_Function, functionIcon);

    wxBitmap classIcon(classicon, wxBITMAP_TYPE_XPM);
    classIcon.SetMask(new wxMask(classicon, maskColor));
    
    RegisterImage(AutoCompleteManager::Type_Class, classIcon);

}
コード例 #4
0
ファイル: TextEditor.cpp プロジェクト: Gaerzi/SLADE
/* TextEditor::TextEditor
 * TextEditor class constructor
 *******************************************************************/
TextEditor::TextEditor(wxWindow* parent, int id)
	: wxStyledTextCtrl(parent, id), timer_update(this)
{
	// Init variables
	language = nullptr;
	ct_argset = 0;
	ct_function = nullptr;
	ct_start = 0;
	bm_cursor_last_pos = -1;
	panel_fr = nullptr;
	call_tip = new SCallTip(this);
	choice_jump_to = nullptr;
	jump_to_calculator = nullptr;

	// Set tab width
	SetTabWidth(txed_tab_width);

	// Line numbers by default
	SetMarginType(0, wxSTC_MARGIN_NUMBER);
	SetMarginWidth(0, TextWidth(wxSTC_STYLE_LINENUMBER, "9999"));

	// Folding margin
	setupFoldMargin();

	// Border margin
	SetMarginWidth(2, 4);

	// Register icons for autocompletion list
	RegisterImage(1, Icons::getIcon(Icons::TEXT_EDITOR, "key"));
	RegisterImage(2, Icons::getIcon(Icons::TEXT_EDITOR, "const"));
	RegisterImage(3, Icons::getIcon(Icons::TEXT_EDITOR, "func"));

	// Init w/no language
	setLanguage(nullptr);

	// Setup various configurable properties
	setup();

	// Add to text styles editor list
	StyleSet::addEditor(this);

	// Bind events
	Bind(wxEVT_KEY_DOWN, &TextEditor::onKeyDown, this);
	Bind(wxEVT_KEY_UP, &TextEditor::onKeyUp, this);
	Bind(wxEVT_STC_CHARADDED, &TextEditor::onCharAdded, this);
	Bind(wxEVT_STC_UPDATEUI, &TextEditor::onUpdateUI, this);
	Bind(wxEVT_STC_CALLTIP_CLICK, &TextEditor::onCalltipClicked, this);
	Bind(wxEVT_STC_DWELLSTART, &TextEditor::onMouseDwellStart, this);
	Bind(wxEVT_STC_DWELLEND, &TextEditor::onMouseDwellEnd, this);
	Bind(wxEVT_LEFT_DOWN, &TextEditor::onMouseDown, this);
	Bind(wxEVT_KILL_FOCUS, &TextEditor::onFocusLoss, this);
	Bind(wxEVT_ACTIVATE, &TextEditor::onActivate, this);
	Bind(wxEVT_STC_MARGINCLICK, &TextEditor::onMarginClick, this);
	Bind(wxEVT_COMMAND_JTCALCULATOR_COMPLETED, &TextEditor::onJumpToCalculateComplete, this);
	Bind(wxEVT_STC_MODIFIED, &TextEditor::onModified, this);
	Bind(wxEVT_TIMER, &TextEditor::onUpdateTimer, this);
	Bind(wxEVT_STC_STYLENEEDED, &TextEditor::onStyleNeeded, this);
}
コード例 #5
0
ファイル: ShuZhi.cpp プロジェクト: github188/MonitorSystem
void CTyHMProxy::Register()
{
  if (m_display==0)
	{
		RegisterImage(m_str1);
		RegisterImage(m_str2);
	} 
	else if (m_display==1)
	{
		RegisterVector(m_str1);
		RegisterVector(m_str2);
	}
}
コード例 #6
0
ファイル: TextEditor.cpp プロジェクト: Aeyesx/SLADE
/* TextEditor::TextEditor
 * TextEditor class constructor
 *******************************************************************/
TextEditor::TextEditor(wxWindow* parent, int id)
	: wxStyledTextCtrl(parent, id)
{
	// Init variables
	language = NULL;
	ct_argset = 0;
	ct_function = NULL;
	ct_start = 0;

	// Set tab width
	SetTabWidth(txed_tab_width);

	// Line numbers by default
	SetMarginType(0, wxSTC_MARGIN_NUMBER);
	SetMarginWidth(0, TextWidth(wxSTC_STYLE_LINENUMBER, "9999"));
	SetMarginWidth(1, 4);

	// Register icons for autocompletion list
	RegisterImage(1, getIcon("ac_key"));
	RegisterImage(2, getIcon("ac_const"));
	RegisterImage(3, getIcon("ac_func"));

	// Init w/no language
	setLanguage(NULL);

	// Find+Replace dialog
	dlg_fr = new FindReplaceDialog(this);

	// Setup various configurable properties
	setup();

	// Bind events
	Bind(wxEVT_KEY_DOWN, &TextEditor::onKeyDown, this);
	Bind(wxEVT_KEY_UP, &TextEditor::onKeyUp, this);
	Bind(wxEVT_STC_CHARADDED, &TextEditor::onCharAdded, this);
	Bind(wxEVT_STC_UPDATEUI, &TextEditor::onUpdateUI, this);
	Bind(wxEVT_STC_CALLTIP_CLICK, &TextEditor::onCalltipClicked, this);
	Bind(wxEVT_STC_DWELLSTART, &TextEditor::onMouseDwellStart, this);
	Bind(wxEVT_STC_DWELLEND, &TextEditor::onMouseDwellEnd, this);
	Bind(wxEVT_LEFT_DOWN, &TextEditor::onMouseDown, this);
	Bind(wxEVT_KILL_FOCUS, &TextEditor::onFocusLoss, this);
	Bind(wxEVT_ACTIVATE, &TextEditor::onActivate, this);
	dlg_fr->getBtnFindNext()->Bind(wxEVT_BUTTON, &TextEditor::onFRDBtnFindNext, this);
	dlg_fr->getBtnReplace()->Bind(wxEVT_BUTTON, &TextEditor::onFRDBtnReplace, this);
	dlg_fr->getBtnReplaceAll()->Bind(wxEVT_BUTTON, &TextEditor::onFRDBtnReplaceAll, this);
	//dlg_fr->getTextFind()->Bind(wxEVT_BUTTON, &TextEditor::onFRDBtnFindNext, this);
	//dlg_fr->getTextReplace()->Bind(wxEVT_BUTTON, &TextEditor::onFRDBtnReplace, this);
	dlg_fr->Bind(wxEVT_CHAR_HOOK, &TextEditor::onFRDKeyDown, this);
}
コード例 #7
0
StyledTextCtrl::StyledTextCtrl(ENIGMA_IDEFrame* frame, const long id)
: wxStyledTextCtrl(frame, id)
{
    mainFrame = frame;

    functionWords = &(frame->fncWords);
    variableWords = &(frame->varWords);
    autoCompWords = &(frame->acpWords);

    SetKeyWords(0, *functionWords);
    SetKeyWords(1, *variableWords);

    ClearRegisteredImages();
    RegisterImage(0, frame->ControlImages->GetBitmap(4));
    RegisterImage(1, frame->ControlImages->GetBitmap(5));

    SetFoldFlags(wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED);

    Connect(wxEVT_STC_MARGINCLICK, wxStyledTextEventHandler(StyledTextCtrl::OnMarginClick), NULL, this);
    Connect(wxEVT_STC_CHARADDED, wxStyledTextEventHandler(StyledTextCtrl::OnAutoComplete), NULL, this);
    Connect(wxEVT_STC_CHANGE, wxStyledTextEventHandler(StyledTextCtrl::OnChange), NULL, this);
}
コード例 #8
0
ファイル: Theme.cpp プロジェクト: andreipaga/audacity
void ThemeBase::RegisterImage( int &iIndex, char const ** pXpm, const wxString & Name )
{

   wxASSERT( iIndex == -1 ); // Don't initialise same bitmap twice!
   wxBitmap Bmp( pXpm ); // a 24 bit bitmap.
   wxImage Img( Bmp.ConvertToImage() );
   Img.InitAlpha();

   //dmazzoni: the top line does not work on wxGTK
   //wxBitmap Bmp2( Img, 32 );
   //wxBitmap Bmp2( Img );

   RegisterImage( iIndex, Img, Name );
}
コード例 #9
0
ファイル: YSH.cpp プロジェクト: github188/MonitorSystem
void CYSH::Ty_Save( CFile *file, BOOL Yn )
{
	if(Yn)	//如果是在进行保存
	{
 		file->Write((unsigned char *)&m_stuYSH.rect,sizeof(m_stuYSH.rect));
		file->Write((unsigned char *)m_stuYSH.ename,sizeof(char)*17);
		file->Write((LPTSTR)(LPCTSTR)m_stuYSH.strBmpName_normal.c_str(),sizeof(m_stuYSH.strBmpName_normal));
		file->Write((LPTSTR)(LPCTSTR)m_stuYSH.strBmpName_warining.c_str(),sizeof(m_stuYSH.strBmpName_warining));
		file->Write((LPTSTR)(LPCTSTR)m_stuYSH.strBmpName_none.c_str(),sizeof(m_stuYSH.strBmpName_none));
	} 
	else
	{
		char readstr[64];

		file->Read((unsigned char *)&m_stuYSH.rect,sizeof(m_stuYSH.rect));
		file->Read((unsigned char *)m_stuYSH.ename,sizeof(char)*17);

		int norsize;
		file->Read((int*)(&norsize), sizeof(int));
		file->Read(readstr,norsize);
		m_stuYSH.strBmpName_normal.assign(readstr,norsize);

		int warnSize;
		file->Read((int*)(&warnSize),sizeof(int));
		file->Read(readstr,warnSize);
		m_stuYSH.strBmpName_warining.assign(readstr,warnSize);

		int closeSize;
		file->Read((int*)(&closeSize),sizeof(int));
		file->Read(readstr,closeSize);
		m_stuYSH.strBmpName_none.assign(readstr,closeSize);

		RegisterImage(m_stuYSH.strBmpName_normal.c_str());
		RegisterImage(m_stuYSH.strBmpName_warining.c_str());
		RegisterImage(m_stuYSH.strBmpName_none.c_str());
	}
}
コード例 #10
0
// ----------------------------------------------------------------------------
SnipImages::SnipImages()
// ----------------------------------------------------------------------------
{
    //ctor

	m_pSnippetsTreeImageList = new wxImageList(16, 16, true, SNIPPETS_TREE_IMAGE_COUNT);
		// Load images
	//wxImage::AddHandler( new wxPNGHandler );
	wxImage::AddHandler( new wxXPMHandler );


	for (int i = 0; i < SNIPPETS_TREE_IMAGE_COUNT; ++i)
	{
        RegisterImage( (char**)xpm_data_ptrs[i]);
	}
}
コード例 #11
0
ファイル: ShuZhi.cpp プロジェクト: github188/MonitorSystem
void CTyHMProxy::Ty_Save(CFile *file, BOOL Yn)
{
	ASSERT_VALID(this);

	if(Yn)	//如果是在进行保存
	{
		file->Write((unsigned char *)&m_x0,sizeof(m_x0));
		file->Write((unsigned char *)&m_y0,sizeof(m_y0));
		file->Write((unsigned char *)&m_x1,sizeof(m_x1));
		file->Write((unsigned char *)&m_y1,sizeof(m_y1));

		file->Write((unsigned char *)m_hmname,sizeof(char)*33);
		file->Write((unsigned char *)&m_display,sizeof(m_display));
		file->Write((unsigned char *)m_str1,sizeof(char)*33);
		file->Write((unsigned char *)m_str2,sizeof(char)*33);
		file->Write((unsigned char *)&m_color1,sizeof(m_color1));
		file->Write((unsigned char *)&m_color2,sizeof(m_color2));
		file->Write((unsigned char *)&m_bFlash,sizeof(m_bFlash));
		file->Write((unsigned char *)&m_FangXiang,sizeof(m_FangXiang));

		file->Write((unsigned char *)&m_TextHeight,sizeof(m_TextHeight));
		file->Write((unsigned char *)&m_TextWidth,sizeof(m_TextWidth));
		file->Write((unsigned char *)&m_JqWidth,sizeof(m_JqWidth));
		file->Write((unsigned char *)m_TextFont,sizeof(char)*16);

		file->Write((unsigned char *)&m_bTranslate1,sizeof(m_bTranslate1));
		file->Write((unsigned char *)&m_bTranslate2,sizeof(m_bTranslate2));

	} 
	else
	{
		file->Read((unsigned char *)&m_x0,sizeof(m_x0));
		file->Read((unsigned char *)&m_y0,sizeof(m_y0));
		file->Read((unsigned char *)&m_x1,sizeof(m_x1));
		file->Read((unsigned char *)&m_y1,sizeof(m_y1));
	
		file->Read((unsigned char *)m_hmname,sizeof(char)*33);
		file->Read((unsigned char *)&m_display,sizeof(m_display));
		file->Read((unsigned char *)m_str1,sizeof(char)*33);
		file->Read((unsigned char *)m_str2,sizeof(char)*33);
		file->Read((unsigned char *)&m_color1,sizeof(m_color1));
		file->Read((unsigned char *)&m_color2,sizeof(m_color2));
		file->Read((unsigned char *)&m_bFlash,sizeof(m_bFlash));
		file->Read((unsigned char *)&m_FangXiang,sizeof(m_FangXiang));

		file->Read((unsigned char *)&m_TextHeight,sizeof(m_TextHeight));
		file->Read((unsigned char *)&m_TextWidth,sizeof(m_TextWidth));
		file->Read((unsigned char *)&m_JqWidth,sizeof(m_JqWidth));
		file->Read((unsigned char *)m_TextFont,sizeof(char)*16);
		file->Read((unsigned char *)&m_bTranslate1,sizeof(m_bTranslate1));
		file->Read((unsigned char *)&m_bTranslate2,sizeof(m_bTranslate2));

		if (m_display==0)
		{
			RegisterImage(m_str1);
			RegisterImage(m_str2);
		
		} 
		else if (m_display==1)
		{
			RegisterVector(m_str1);
			RegisterVector(m_str2);
		}

	}

}