当前位置: 首页>>代码示例>>C++>>正文


C++ wxCHECK函数代码示例

本文整理汇总了C++中wxCHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ wxCHECK函数的具体用法?C++ wxCHECK怎么用?C++ wxCHECK使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wxCHECK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: wxCHECK

/// Performs deserialization for the class
/// @param stream Power Tab input stream to load from
/// @param version File version
/// @return True if the object was deserialized, false if not
bool ChordDiagram::DoDeserialize(PowerTabInputStream& stream, wxWord version)
{
    //------Last Checked------//
    // - Jan 14, 2005
    m_chordName.Deserialize(stream, version);
    wxCHECK(stream.CheckState(), false);
    
	stream >> m_topFret;
	wxCHECK(stream.CheckState(), false);
	
	wxByte count = 0;
	stream >> count;
	wxCHECK(stream.CheckState(), false);

	size_t i = 0;
	for (; i < count; i++)
	{
	    wxByte fretNumber = 0;
	    stream >> fretNumber;
	    wxCHECK(stream.CheckState(), false);
	    
	    m_fretNumberArray.Add(fretNumber);
    }
    	
    return (true);
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:30,代码来源:chorddiagram.cpp

示例2: wxCHECK

// forward the message to the appropriate item
bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
{
    // only owner-drawn control should receive this message
    wxCHECK( ((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), false );

    DRAWITEMSTRUCT *pStruct = (DRAWITEMSTRUCT *)item;
    UINT itemID = pStruct->itemID;

    // the item may be -1 for an empty listbox
    if ( itemID == (UINT)-1 )
        return false;

    long data = ListBox_GetItemData(GetHwnd(), pStruct->itemID);

    wxCHECK( data && (data != LB_ERR), false );

    wxListBoxItem *pItem = (wxListBoxItem *)data;

    wxDCTemp dc((WXHDC)pStruct->hDC);
    wxPoint pt1(pStruct->rcItem.left, pStruct->rcItem.top);
    wxPoint pt2(pStruct->rcItem.right, pStruct->rcItem.bottom);
    wxRect rect(pt1, pt2);

    return pItem->OnDrawItem(dc, rect,
                             (wxOwnerDrawn::wxODAction)pStruct->itemAction,
                             (wxOwnerDrawn::wxODStatus)pStruct->itemState);
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:28,代码来源:listbox.cpp

示例3: return

/// Passes the results of a test to the test suite callback function
/// @param record Indicates whether or note the results of the test should be recorded to the results tree ctrl if the test was successful
/// @param startTime The time when the test was started
/// @param testName Name of the test
/// @param success Indicates the success/failure of the test
/// @param fileName Name of the file where the test occurred
/// @param lineNumber Line number in the file where the test occurred
bool TestSuite::Test(bool record, wxLongLong startTime, const wxChar* testName, bool success, char* fileName, size_t lineNumber)
{
    //------Last Checked------//
    // - Dec 2, 2004
           
    // Calculate the time to execute the test (in seconds)
    wxLongLong span = ::wxGetLocalTimeMillis() - startTime;
    double executionTime = ((double)span.ToLong()) / 1000.0;

    // If the test suite isn't being executed, bail out
    if (!IsExecuted())
        return (false);

    // Update the success or failure of the test
    if (success)
        m_passed++;
    else
        m_failed++;

    wxCHECK(testName != NULL, false);
    wxCHECK(fileName != NULL, false);
    wxCHECK(m_testSuiteCallback != NULL, false);

    // Create a temp string used for the filename (since it's ANSI and we want it this to work on Unicode builds)
    wxString tempFileName(fileName);

    // Send the results of the test to the callback
    return (m_testSuiteCallback(this, testName, success, tempFileName, lineNumber, record, executionTime, m_clientData));
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:36,代码来源:testsuite.cpp

示例4: WXUNUSED

// Overrides
bool PowerTabView::OnCreate(wxDocument *doc, long flags)
{
    //------Last Checked------//
    // - Jan 27, 2005
    WXUNUSED(flags);
    
    MainFrame* mainFrame = GetMainFrame();
    wxCHECK(mainFrame != NULL, false);
    
    m_frame = mainFrame->CreateChildFrame(doc, this);
    wxCHECK(m_frame != NULL, false);
    
    m_frame->SetTitle(wxT("PowerTabView"));

    m_canvas = CreateCanvas(this, m_frame);
    wxCHECK(m_canvas != NULL, false);
    
#ifdef __X__
    // X seems to require a forced resize
    int x, y;
    m_frame->GetSize(&x, &y);
    m_frame->SetSize(-1, -1, x, y);
#endif

    m_frame->Show(true);
    Activate(true);

    return (true);
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:30,代码来源:powertabview.cpp

示例5: WXUNUSED

// Overrides
bool PowerTabTuningView::OnCreate(wxDocument* doc, long flags)
{
    //------Last Checked------//
    // - Dec 30, 2004
    WXUNUSED(flags);
    
    MainFrame* mainFrame = GetMainFrame();
    wxCHECK(mainFrame != NULL, false);
    
    m_frame = mainFrame->CreateChildFrame(doc, this);
    wxCHECK(m_frame != NULL, false);
    
    m_window = CreateViewWindow();
    wxCHECK(m_window != NULL, false);
    
#ifdef __X__
    // X seems to require a forced resize
    int x, y;
    m_frame->GetSize(&x, &y);
    m_frame->SetSize(-1, -1, x, y);
#endif
    
    m_frame->Show(true);
    Activate(true);
    
    return (true);
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:28,代码来源:powertabtuningview.cpp

示例6: wxCHECK

// Fret Number Functions
/// Sets the fret number for an existing string in the chordDiagram
/// @param string String to set the fret number for
/// @param fretNumber Fret number to set
/// @return True if the fret number was set, false if not
bool ChordDiagram::SetFretNumber(wxUint32 string, wxByte fretNumber)
{
    //------Last Checked------//
    // - Jan 15, 2005
    wxCHECK(IsValidString(string), false);
    wxCHECK(IsValidFretNumber(fretNumber), false);
    m_fretNumberArray[string] = fretNumber;
    return (true);
}
开发者ID:RaptDept,项目名称:ptparser,代码行数:14,代码来源:chorddiagram.cpp

示例7: wxCHECK

bool wxPropertyGridInterface::SetColumnProportion( unsigned int column,
                                                   int proportion )
{
    wxCHECK(m_pState, false);
    wxPropertyGrid* pg = m_pState->GetGrid();
    wxCHECK(pg, false);
    wxCHECK(pg->HasFlag(wxPG_SPLITTER_AUTO_CENTER), false);
    m_pState->DoSetColumnProportion(column, proportion);
    return true;
}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:10,代码来源:propgridiface.cpp

示例8: wxCHECK

bool CXmlFile::Save(wxString* error)
{
	wxCHECK(m_fileName.IsOk(), false);

	wxCHECK(m_pDocument, false);

	bool res = SaveXmlFile(m_fileName, GetElement(), error);
	wxLogNull log;
	m_modificationTime = m_fileName.GetModificationTime();
	return res;
}
开发者ID:bartojak,项目名称:osp-filezilla,代码行数:11,代码来源:xmlfunctions.cpp

示例9: wxCHECK

// Serialization Functions
/// Performs serialization for the class
/// @param stream Power Tab output stream to serialize to
/// @return True if the object was serialized, false if not
bool ChordText::DoSerialize(PowerTabOutputStream& stream)
{
    //------Last Checked------//
    // - Jan 3, 2005
    stream << m_position;
    wxCHECK(stream.CheckState(), false);
    
    m_chordName.Serialize(stream);
    wxCHECK(stream.CheckState(), false);
    
    return (stream.CheckState());
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:16,代码来源:chordtext.cpp

示例10: wxCHECK

int wxStatusBarEx::GetFieldIndex(int field)
{
	if (field >= 0) {
		wxCHECK(field <= GetFieldsCount(), -1);
	}
	else {
		field = GetFieldsCount() + field;
		wxCHECK(field >= 0, -1);
	}

	return field;
}
开发者ID:Typz,项目名称:FileZilla,代码行数:12,代码来源:statusbar.cpp

示例11: wxCHECK

bool wxTreeMultiXmlMapper::InitWizard(const wxFileName &xmlfile, const wxString &start_tag)
{
    wxCHECK(m_ctrl, false);

    // create a new XML document
    InitXML();
    wxCHECK(m_tiDoc, false);

    // load the contents from disk
    if(m_tiDoc->LoadFile(xmlfile.GetFullPath().c_str()))
        return DoInitWizard(start_tag);

	return false;
}
开发者ID:mp-lee,项目名称:wxdevcpp,代码行数:14,代码来源:TreeMultiXmlMapper.cpp

示例12: wxCHECK

// Serialize Functions
/// Performs serialization for the class
/// @param stream Power Tab output stream to serialize to
/// @return True if the object was serialized, false if not
bool System::DoSerialize(PowerTabOutputStream& stream)
{
    //------Last Checked------//
    // - Jan 14, 2005
    stream.WriteMFCRect(m_rect);
    wxCHECK(stream.CheckState(), false);
    
    // Note: End bar is stored as a byte; we use Barline class to make it easier
    // for the user
    wxByte endBar = (wxByte)((m_endBar.GetType() << 5) |
        (m_endBar.GetRepeatCount()));
    stream << endBar << m_positionSpacing << m_rhythmSlashSpacingAbove <<
        m_rhythmSlashSpacingBelow << m_extraSpacing;
    wxCHECK(stream.CheckState(), false);
    
    m_startBar.Serialize(stream);
    wxCHECK(stream.CheckState(), false);

    m_directionArray.Serialize(stream);
    wxCHECK(stream.CheckState(), false);
    
    m_chordTextArray.Serialize(stream);
    wxCHECK(stream.CheckState(), false);
    
    m_rhythmSlashArray.Serialize(stream);
    wxCHECK(stream.CheckState(), false);
    
    m_staffArray.Serialize(stream);
    wxCHECK(stream.CheckState(), false);
    
    m_barlineArray.Serialize(stream);
    wxCHECK(stream.CheckState(), false);

    return (stream.CheckState());
}
开发者ID:RaptDept,项目名称:ptparser,代码行数:39,代码来源:system.cpp

示例13: WXUNUSED

// Serialization Functions
/// Performs deserialization for the class
/// @param stream Power Tab input stream to load from
/// @param version File version
/// @return True if the object was deserialized, false if not
bool OldRehearsalSign::DoDeserialize(PowerTabInputStream& stream, wxWord version)
{
    //------Last Checked------//
    // - Dec 29, 2004
    WXUNUSED(version);
    
    stream >> m_system >> m_position >> m_data >> m_letter;
    wxCHECK(stream.CheckState(), false);
    
    stream.ReadMFCString(m_description);
    wxCHECK(stream.CheckState(), false);
    
    return (stream.CheckState());
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:19,代码来源:oldrehearsalsign.cpp

示例14: wxCHECK

// recursive
CAICHHashTree* CAICHHashTree::FindHash(uint64 nStartPos, uint64 nSize, uint8* nLevel)
{
	(*nLevel)++;
	
	wxCHECK(*nLevel <= 22, NULL);
	wxCHECK(nStartPos + nSize <= m_nDataSize, NULL);
	wxCHECK(nSize <= m_nDataSize, NULL);
	
	if (nStartPos == 0 && nSize == m_nDataSize) {
		// this is the searched hash
		return this;
	} else if (m_nDataSize <= m_nBaseSize) { // sanity
		// this is already the last level, cant go deeper
		wxFAIL;
		return NULL;
	} else {
		uint64 nBlocks = m_nDataSize / m_nBaseSize + ((m_nDataSize % m_nBaseSize != 0 )? 1:0); 
		uint64 nLeft = (((m_bIsLeftBranch) ? nBlocks+1:nBlocks) / 2)* m_nBaseSize;
		uint64 nRight = m_nDataSize - nLeft;
		if (nStartPos < nLeft) {
			if (nStartPos + nSize > nLeft) { // sanity
				wxFAIL;
				return NULL;
			}
			
			if (m_pLeftTree == NULL) {
				m_pLeftTree = new CAICHHashTree(nLeft, true, (nLeft <= PARTSIZE) ? EMBLOCKSIZE : PARTSIZE);
			} else {
				wxASSERT( m_pLeftTree->m_nDataSize == nLeft );
			}
			
			return m_pLeftTree->FindHash(nStartPos, nSize, nLevel);
		} else {
			nStartPos -= nLeft;
			if (nStartPos + nSize > nRight) { // sanity
				wxFAIL;
				return NULL;
			}
			
			if (m_pRightTree == NULL) {
				m_pRightTree = new CAICHHashTree(nRight, false, (nRight <= PARTSIZE) ? EMBLOCKSIZE : PARTSIZE);
			} else {
				wxASSERT( m_pRightTree->m_nDataSize == nRight ); 
			}
			
			return m_pRightTree->FindHash(nStartPos, nSize, nLevel);
		}
	}
}
开发者ID:dreamerc,项目名称:amule,代码行数:50,代码来源:SHAHashSet.cpp

示例15: wxCHECK

/// Performs serialization for the class
/// @param stream Power Tab output stream to serialize to
/// @return True if the object was serialized, false if not
bool FontSetting::DoSerialize(PowerTabOutputStream& stream)
{
    //------Last Checked------//
    // - Dec 5, 2004
    stream.WriteMFCString(m_faceName);
    wxCHECK(stream.CheckState(), false);
    
    stream << m_pointSize << m_weight << m_italic << m_underline << m_strikeOut;
    wxCHECK(stream.CheckState(), false);
    
    stream.WriteWin32ColorRef(m_color);
    wxCHECK(stream.CheckState(), false);
    
    return (stream.CheckState());
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:18,代码来源:fontsetting.cpp


注:本文中的wxCHECK函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。