本文整理汇总了C++中wxStyledTextEvent::GetMargin方法的典型用法代码示例。如果您正苦于以下问题:C++ wxStyledTextEvent::GetMargin方法的具体用法?C++ wxStyledTextEvent::GetMargin怎么用?C++ wxStyledTextEvent::GetMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxStyledTextEvent
的用法示例。
在下文中一共展示了wxStyledTextEvent::GetMargin方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMarginClick
////////////////////////////////////////////////////////////////////////////////
// OnMarginClick()
//
// This function handles the user clicks in the margin to the left of a
// line of source code. We use the margin to display breakpoint indicators
// so it makes sense that if you click on an breakpoint indicator, we will
// clear that breakpoint. If you click on a spot that does not contain a
// breakpoint indicator (but it's still in the margin), we create a new
// breakpoint at that line
//
// Parametes:
// Selection Event Object
//
void frmDebugger::OnMarginClick(wxStyledTextEvent &event)
{
int lineNo;
// Check that the user clicked on the line number or breakpoint margin
// We don't want to set a breakpoint when the user folds/unfolds code
if (!(event.GetMargin() == 0 || event.GetMargin() == 1))
return;
lineNo = m_codeViewer->LineFromPosition(event.GetPosition());
if (lineNo <= 0)
return;
// If we already have a breakpoint at the clickpoint, disable it, otherwise
// create a new breakpoint
if(m_codeViewer->MarkerGet(lineNo) &
MARKERINDEX_TO_MARKERMASK(MARKER_BREAKPOINT))
{
m_controller->ClearBreakpoint(lineNo);
}
else
{
m_controller->SetBreakpoint(lineNo);
}
m_controller->UpdateBreakpoints();
}
示例2: OnMarginClick
void ctlSQLBox::OnMarginClick(wxStyledTextEvent &event)
{
if (event.GetMargin() == 2)
ToggleFold(LineFromPosition(event.GetPosition()));
event.Skip();
}
示例3: OnMarginClick
//! misc
void Edit::OnMarginClick (wxStyledTextEvent &event) {
if (event.GetMargin() == 2) {
int lineClick = LineFromPosition (event.GetPosition());
int levelClick = GetFoldLevel (lineClick);
if ((levelClick & wxSTC_FOLDLEVELHEADERFLAG) > 0) {
ToggleFold (lineClick);
}
}
}
示例4: onMarginClick
/* TextEditor::onMarginClick
* Called when a margin is clicked
*******************************************************************/
void TextEditor::onMarginClick(wxStyledTextEvent& e)
{
if (e.GetMargin() == 1)
{
int line = LineFromPosition(e.GetPosition());
int level = GetFoldLevel(line);
if ((level & wxSTC_FOLDLEVELHEADERFLAG) > 0)
ToggleFold(line);
updateFolding();
}
}
示例5: OnMarginClick
void IWnd_stc::OnMarginClick (wxStyledTextEvent &evt)
{
if (evt.GetMargin() == StcManager::FOLDING_ID)
{
int lineClick = LineFromPosition (evt.GetPosition());
int levelClick = GetFoldLevel (lineClick);
if ((levelClick & wxSTC_FOLDLEVELHEADERFLAG) > 0)
{
ToggleFold (lineClick);
}
}
}
示例6:
// Event callback when a margin is clicked, used here for code folding
void SavvyEditor::AppFrame::OnMarginClick(wxStyledTextEvent& a_Event)
{
if (a_Event.GetMargin() == MARGIN_FOLD)
{
int lineClick = m_LastSelectedTextCtrl->LineFromPosition(a_Event.GetPosition());
int levelClick = m_LastSelectedTextCtrl->GetFoldLevel(lineClick);
if ((levelClick & wxSTC_FOLDLEVELHEADERFLAG) > 0)
{
m_LastSelectedTextCtrl->ToggleFold(lineClick);
}
}
}
示例7: OnMarginClick
void udCodeEditorPanel::OnMarginClick ( wxStyledTextEvent &event )
{
if ( event.GetMargin() == 1 )
{
int lineClick = m_scintillaEditor->LineFromPosition ( event.GetPosition() );
int levelClick = m_scintillaEditor->GetFoldLevel ( lineClick );
if ( ( levelClick & wxSTC_FOLDLEVELHEADERFLAG ) > 0 )
{
m_scintillaEditor->ToggleFold ( lineClick );
}
}
}
示例8: OnMarginClick
void TextFrame::OnMarginClick(wxStyledTextEvent& event)
{
if (event.GetMargin() == MARGIN_FOLD) {
wxStyledTextCtrl* txt = getCurrentTextCtrl();
if(txt)
{
int line = txt->LineFromPosition(event.GetPosition());
int levelClick = txt->GetFoldLevel (line);
if ((levelClick & wxSTC_FOLDLEVELHEADERFLAG) > 0) {
txt->ToggleFold (line);
}
}
}
}
示例9: OnMarginClick
void FileEditorWnd::OnMarginClick(wxStyledTextEvent& event)
{
switch(event.GetMargin())
{
case MARGIN_BREAKPOINTS:
{
doBreakpoint(m_textCtrl->LineFromPosition(event.GetPosition()));
}
break;
case MARGIN_FOLD:
{
int txtline = m_textCtrl->LineFromPosition(event.GetPosition());
int levelClick = m_textCtrl->GetFoldLevel(txtline);
if ((levelClick & wxSTC_FOLDLEVELHEADERFLAG) > 0)
{
m_textCtrl->ToggleFold(txtline);
}
}
break;
}
}
示例10: OnMarginClick
void OutputTabWindow::OnMarginClick(wxStyledTextEvent& e)
{
if(m_sci && e.GetMargin() == 4) {
m_sci->ToggleFold(m_sci->LineFromPosition(e.GetPosition()));
}
}