• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetEditable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: gtk_editable_select_region

void wxTextEntry::SetSelection(long from, long to)
{
    // in wx convention, (-1, -1) means the entire range but GTK+ translates -1
    // (or any negative number for that matter) into last position so we need
    // to translate manually
    if ( from == -1 && to == -1 )
        from = 0;

    // for compatibility with MSW, exchange from and to parameters so that the
    // insertion point is set to the start of the selection and not its end as
    // GTK+ does by default
    gtk_editable_select_region(GetEditable(), to, from);

#ifndef __WXGTK3__
    // avoid reported problem with RHEL 5 GTK+ 2.10 where selection is reset by
    // a clipboard callback, see #13277
    if (gtk_check_version(2,12,0))
    {
        GtkEntry* entry = GTK_ENTRY(GetEditable());
        if (to < 0)
            to = entry->text_length;
        entry->selection_bound = to;
    }
#endif
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:25,代码来源:textentry.cpp


示例2: GetEditable

bool GroupCell::SetEditableContent(wxString text)
{
  if (GetEditable()) {
    GetEditable()->SetValue(text);
    return true;
  }
  else
    return false;
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:9,代码来源:GroupCell.cpp


示例3: DoAutoCompleteStrings

bool wxTextEntry::DoAutoCompleteStrings(const wxArrayString& choices)
{
    GtkEntry* const entry = (GtkEntry*)GetEditable();
    wxCHECK_MSG(GTK_IS_ENTRY(entry), false, "auto completion doesn't work with this control");

    GtkListStore * const store = gtk_list_store_new(1, G_TYPE_STRING);
    GtkTreeIter iter;

#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
    for ( wxArrayString::const_iterator i = choices.begin();
          i != choices.end();
          ++i )
    {
        gtk_list_store_append(store, &iter);
        gtk_list_store_set(store, &iter,
                           0, (const gchar *)i->utf8_str(),
                           -1);
    }

    GtkEntryCompletion * const completion = gtk_entry_completion_new();
    gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(store));
    gtk_entry_completion_set_text_column(completion, 0);
    gtk_entry_set_completion(entry, completion);
    g_object_unref(completion);
    return true;
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:34,代码来源:textentry.cpp


示例4: GetEditable

void wxTextEntry::WriteText(const wxString& value)
{
    GtkEditable * const edit = GetEditable();

    // remove the selection if there is one and suppress the text change event
    // generated by this: we only want to generate one event for this change,
    // not two
    {
        EventsSuppressor noevents(this);
        gtk_editable_delete_selection(edit);
    }

    // insert new text at the cursor position
    gint len = gtk_editable_get_position(edit);
    gtk_editable_insert_text
    (
        edit,
        wxGTK_CONV_FONT(value, GetEditableWindow()->GetFont()),
        -1,     // text: length: compute it using strlen()
        &len    // will be updated to position after the text end
    );

    // and move cursor to the end of new text
    gtk_editable_set_position(edit, len);
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:25,代码来源:textentry.cpp


示例5: GetSelection

void wxTextEntry::GetSelection(long *from, long *to) const
{
    gint start, end;
    if ( gtk_editable_get_selection_bounds(GetEditable(), &start, &end) )
    {
        // the output must always be in order, although in GTK+ it isn't
        if ( start > end )
        {
            gint tmp = start;
            start = end;
            end = tmp;
        }
    }
    else // no selection
    {
        // for compatibility with MSW return the empty selection at cursor
        start =
        end = GetInsertionPoint();
    }

    if ( from )
        *from = start;

    if ( to )
        *to = end;
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:26,代码来源:textentry.cpp


示例6: DoAutoCompleteStrings

bool wxTextEntry::DoAutoCompleteStrings(const wxArrayString& choices)
{
    GtkEntry* const entry = (GtkEntry*)GetEditable();
    wxCHECK_MSG(GTK_IS_ENTRY(entry), false, "auto completion doesn't work with this control");

    GtkListStore * const store = gtk_list_store_new(1, G_TYPE_STRING);
    GtkTreeIter iter;

    for ( wxArrayString::const_iterator i = choices.begin();
          i != choices.end();
          ++i )
    {
        gtk_list_store_append(store, &iter);
        gtk_list_store_set(store, &iter,
                           0, (const gchar *)i->utf8_str(),
                           -1);
    }

    GtkEntryCompletion * const completion = gtk_entry_completion_new();
    gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(store));
    gtk_entry_completion_set_text_column(completion, 0);
    gtk_entry_set_completion(entry, completion);
    g_object_unref(completion);
    return true;
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:25,代码来源:textentry.cpp


示例7: value

wxString wxTextEntry::DoGetValue() const
{
    const wxGtkString value(gtk_editable_get_chars(GetEditable(), 0, -1));

    return wxGTK_CONV_BACK_FONT(value,
            const_cast<wxTextEntry *>(this)->GetEditableWindow()->GetFont());
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:7,代码来源:textentry.cpp


示例8: GTK_ENTRY

long wxTextEntry::GetLastPosition() const
{
    // this can't be implemented for arbitrary GtkEditable so only do it for
    // GtkEntries
    GtkEntry * const entry = GTK_ENTRY(GetEditable());

    return entry ? entry->text_length : - 1;
}
开发者ID:NullNoname,项目名称:dolphin,代码行数:8,代码来源:textentry.cpp


示例9: SetMaxLength

void wxTextEntry::SetMaxLength(unsigned long len)
{
    GtkEntry* const entry = (GtkEntry*)GetEditable();
    if (!GTK_IS_ENTRY(entry))
        return;

    gtk_entry_set_max_length(entry, len);
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:8,代码来源:textentry.cpp


示例10: DestroyOutput

void GroupCell::RemoveOutput()
{
  DestroyOutput();
  ResetSize();
  m_height = GetEditable()->GetHeight();
  m_output = NULL;
  m_lastInOutput = NULL;
  m_appendedCells = NULL;
  m_hide = false;
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:10,代码来源:GroupCell.cpp


示例11: GetLastPosition

long wxTextEntry::GetLastPosition() const
{
    // this can't be implemented for arbitrary GtkEditable so only do it for
    // GtkEntries
    long pos = -1;
    GtkEntry* entry = (GtkEntry*)GetEditable();
    if (GTK_IS_ENTRY(entry))
        pos = gtk_entry_get_text_length(entry);

    return pos;
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:11,代码来源:textentry.cpp


示例12: gtk_editable_select_region

void wxTextEntry::SetSelection(long from, long to)
{
    // in wx convention, (-1, -1) means the entire range but GTK+ translates -1
    // (or any negative number for that matter) into last position so we need
    // to translate manually
    if ( from == -1 && to == -1 )
        from = 0;

    // for compatibility with MSW, exchange from and to parameters so that the
    // insertion point is set to the start of the selection and not its end as
    // GTK+ does by default
    gtk_editable_select_region(GetEditable(), to, from);
}
开发者ID:NullNoname,项目名称:dolphin,代码行数:13,代码来源:textentry.cpp


示例13: GetEditable

void GroupCell::Hide(bool hide) {
  if (IsFoldable())
    return;

  if (m_hide == hide)
    return;
  else
  {
    if (m_hide == false) {
      if ((m_groupType == GC_TYPE_TEXT) || (m_groupType == GC_TYPE_CODE))
        GetEditable()->SetFirstLineOnly(true);
      m_hide = true;
    }
    else {
      if ((m_groupType == GC_TYPE_TEXT) || (m_groupType == GC_TYPE_CODE))
        GetEditable()->SetFirstLineOnly(false);
      m_hide = false;
    }

    ResetSize();
    GetEditable()->ResetSize();
  }
}
开发者ID:BlackEdder,项目名称:wxmaxima,代码行数:23,代码来源:GroupCell.cpp


示例14: ToString

wxString GroupCell::ToString()
{
  wxString str;
  if (GetEditable()) {
    str = m_input->ListToString();
    if (m_output != NULL && !m_hide) {
      MathCell *tmp = m_output;
      while (tmp != NULL) {
        if (tmp->ForceBreakLineHere() && str.Length()>0)
          str += wxT("\n");
        str += tmp->ToString();
        tmp = tmp->m_nextToDraw;
      }
    }
  }
  return str;
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:17,代码来源:GroupCell.cpp


示例15: gtk_editable_set_position

void wxTextEntry::SetInsertionPoint(long pos)
{
    gtk_editable_set_position(GetEditable(), pos);
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:4,代码来源:textentry.cpp


示例16: gtk_editable_set_editable

void wxTextEntry::SetEditable(bool editable)
{
    gtk_editable_set_editable(GetEditable(), editable);
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:4,代码来源:textentry.cpp


示例17: gtk_editable_get_editable

bool wxTextEntry::IsEditable() const
{
    return gtk_editable_get_editable(GetEditable()) != 0;
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:4,代码来源:textentry.cpp


示例18: wxT


//.........这里部分代码省略.........
                  str << wxT("\\includegraphics[width=.95\\linewidth,height=.80\\textheight,keepaspectratio]{")+Frame+wxT("}\n");
                else
                  str << wxT("\n\\verb|<<GRAPHICS>>|\n");
                if(i<src->Length()-1)
                  str << wxT("\\newframe");
              }
              str << wxT("\\end{animateinline}");
            }
	    else
            {
              wxString file = imgDir + wxT("/") + image + wxT(".png");
              
              Bitmap bmp;
              bmp.SetData(copy);
              if (bmp.ToFile(file).x>=0)
                str += wxT("\\includegraphics[width=.95\\linewidth,height=.80\\textheight,keepaspectratio]{") +
                  filename + wxT("_img/") + image + wxT("}");
              else
                str << wxT("\n\\verb|<<GRAPHICS>>|\n");
            }
	  }
	}
        else if (tmp->GetStyle() == TS_LABEL)
        {
	  if(mathMode)
	    str += wxT("\\end{math}\n\n\\begin{math}\\displaystyle\n");
	  else
	    {
	      str += wxT("\n\n\\begin{math}\\displaystyle\n");
	      mathMode=true;
	    }
          str += wxT("\\parbox{8ex}{\\color{labelcolor}") + tmp->ToTeX() + wxT("}\n");
        }
	
        else
	  {
	    if((tmp->GetStyle() == TS_DEFAULT)||(tmp->GetStyle() == TS_STRING))
	      {
		// We either got a bracket or a parenthesis or regular Text
		// that shouldn't be displayed as math.
		if((mathMode)&&(tmp->ToString().Length()>2))
		  {
		    str += wxT("\\mbox{}");
		    str += wxT("\n\\end{math}\n");
		    mathMode = false;
		  }
	      }
	    else
	      {
		if(!mathMode)
		  {
		    str += wxT("\n\n\\begin{math}\\displaystyle\n");
		    mathMode = true;
		  }
	      }		
	    str += TexEscapeOutputCell(tmp->ToTeX());
	  }
        tmp = tmp->m_nextToDraw;
      }
      if(mathMode)
	{
	  // Some invisible dummy content that keeps TeX happy if there really is
	  // no output to display.
	  str += wxT("\\mbox{}");
	  str += wxT("\n\\end{math}\n%%%%%%%%%%%%%%%\n");
	}
    }
  }

  // TITLES, SECTIONS, SUBSECTIONS, SUBSUBSECTIONS, TEXT
  else if (GetEditable() != NULL && !m_hide) {
    str = GetEditable()->ListToTeX();
    switch (GetEditable()->GetStyle()) {
      case TS_TITLE:
        str = wxT("\n\\pagebreak{}\n{\\Huge {\\sc ") + PrepareForTeX(str) + wxT("}}\n");
        str += wxT("\\setcounter{section}{0}\n\\setcounter{subsection}{0}\n");
        str += wxT("\\setcounter{figure}{0}\n\n");
        break;
      case TS_SECTION:
        str = wxT("\n\\section{") + PrepareForTeX(str) + wxT("}\n\n");
        break;
      case TS_SUBSECTION:
        str = wxT("\n\\subsection{") + PrepareForTeX(str) + wxT("}\n\n");
        break;
      case TS_SUBSUBSECTION:
        str = wxT("\n\\subsubsection{") + PrepareForTeX(str) + wxT("}\n\n");
        break;
      default:
        if (str.StartsWith(wxT("TeX:")))
          str = str.Mid(5, str.Length());
        else {
          str = PrepareForTeX(str);
	  str = MarkDownParser.MarkDown(str);
        }
        break;
    }
  }
    
  return str;
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:101,代码来源:GroupCell.cpp


示例19: RecalculateWidths

void GroupCell::Draw(CellParser& parser, wxPoint point, int fontsize)
{
  double scale = parser.GetScale();
  wxDC& dc = parser.GetDC();
  if (m_width == -1 || m_height == -1) {
    RecalculateWidths(parser, fontsize);
    RecalculateSize(parser, fontsize);
  }
  if (DrawThisCell(parser, point))
  {
    // draw a thick line for 'page break'
    // and return
    if (m_groupType == GC_TYPE_PAGEBREAK) {
      wxRect rect = GetRect(false);
      int y = rect.GetY();
      wxPen pen(parser.GetColor(TS_CURSOR), 1, wxPENSTYLE_DOT);
      dc.SetPen(pen);
      dc.DrawLine(0, y , 10000, y);
      MathCell::Draw(parser, point, fontsize);
      return;
    }

    //
    // Paint background if we have a text cell
    //
    if (m_groupType == GC_TYPE_TEXT) {
      wxRect rect = GetRect(false);
      int y = rect.GetY();

      if (m_height > 0 && m_width > 0 && y>=0) {
        wxBrush br(parser.GetColor(TS_TEXT_BACKGROUND));
        dc.SetBrush(br);
        wxPen pen(parser.GetColor(TS_TEXT_BACKGROUND));
        dc.SetPen(pen);
        dc.DrawRectangle(0, y , 10000, rect.GetHeight());
      }
    }
    //
    // Draw input and output
    //
    SetPen(parser);
    wxPoint in(point);
    parser.Outdated(false);
    m_input->DrawList(parser, in, fontsize);
    if (m_groupType == GC_TYPE_CODE && m_input->m_next)
      parser.Outdated(((EditorCell *)(m_input->m_next))->ContainsChanges());

    if (m_output != NULL && !m_hide) {
      MathCell *tmp = m_output;
      int drop = tmp->GetMaxDrop();
      in.y += m_input->GetMaxDrop() + m_output->GetMaxCenter();
      m_outputRect.y = in.y - m_output->GetMaxCenter();
      m_outputRect.x = in.x;

      while (tmp != NULL) {

        if (!tmp->m_isBroken) {
          tmp->m_currentPoint.x = in.x;
          tmp->m_currentPoint.y = in.y;
          if (tmp->DrawThisCell(parser, in))
            tmp->Draw(parser, in, MAX(tmp->IsMath() ? m_mathFontSize : m_fontSize, MC_MIN_SIZE));
          if (tmp->m_nextToDraw != NULL) {
            if (tmp->m_nextToDraw->BreakLineHere()) {
              in.x = m_indent;
              in.y += drop + tmp->m_nextToDraw->GetMaxCenter();
              if (tmp->m_bigSkip)
                in.y += MC_LINE_SKIP;
              drop = tmp->m_nextToDraw->GetMaxDrop();
            } else
              in.x += (tmp->GetWidth() + MC_CELL_SKIP);
          }

        } else {
          if (tmp->m_nextToDraw != NULL && tmp->m_nextToDraw->BreakLineHere()) {
            in.x = m_indent;
            in.y += drop + tmp->m_nextToDraw->GetMaxCenter();
            if (tmp->m_bigSkip)
              in.y += MC_LINE_SKIP;
            drop = tmp->m_nextToDraw->GetMaxDrop();
          }
        }

        tmp = tmp->m_nextToDraw;
      }
    }

    parser.Outdated(false);
    MathCell *editable = GetEditable();
    if (editable != NULL && editable->IsActive()) {
      dc.SetPen( *(wxThePenList->FindOrCreatePen(parser.GetColor(TS_ACTIVE_CELL_BRACKET), 2, wxPENSTYLE_SOLID))); // window linux, set a pen
      dc.SetBrush( *(wxTheBrushList->FindOrCreateBrush(parser.GetColor(TS_ACTIVE_CELL_BRACKET)))); //highlight c.
    }
    else {
      dc.SetPen( *(wxThePenList->FindOrCreatePen(parser.GetColor(TS_CELL_BRACKET), 1, wxPENSTYLE_SOLID))); // window linux, set a pen
      dc.SetBrush( *(wxTheBrushList->FindOrCreateBrush(parser.GetColor(TS_CELL_BRACKET)))); //highlight c.
    }

    if ((!m_hide) && (!m_hiddenTree)) {
      dc.SetBrush(*wxTRANSPARENT_BRUSH);
    }
//.........这里部分代码省略.........
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:101,代码来源:GroupCell.cpp


示例20: wxT


//.........这里部分代码省略.........
  }
  else if (m_groupType == GC_TYPE_IMAGE)
    str << wxT("\n\\vert|<<GRAPHICS>>|\n");

  // CODE CELLS
  else if (m_groupType == GC_TYPE_CODE) {
    // Input cells
    str = wxT("\n\\noindent\n%%%%%%%%%%%%%%%\n")
          wxT("%%% INPUT:\n")
          wxT("\\begin{minipage}[t]{8ex}{\\color{red}\\bf\n")
          wxT("\\begin{verbatim}\n") +
          m_input->ToString(false) +
          wxT("\n\\end{verbatim}}\n\\end{minipage}");

    if (m_input->m_next!=NULL)
    {
      str += wxT("\n\\begin{minipage}[t]{\\textwidth}{\\color{blue}\n\\begin{verbatim}\n") +
             m_input->m_next->ToString(true) +
             wxT("\n\\end{verbatim}}\n\\end{minipage}");
    }

    str += wxT("\n");

    if (m_output != NULL) {
      str += wxT("%%% OUTPUT:\n");
      // Need to define labelcolor if this is Copy as LaTeX!
      if (imgCounter == NULL)
        str += wxT("\\definecolor{labelcolor}{RGB}{100,0,0}\n");
      str += wxT("\\begin{math}\\displaystyle\n");
      MathCell *tmp = m_output;

      while (tmp != NULL) {

        if (tmp->GetType() == MC_TYPE_IMAGE || tmp->GetType() == MC_TYPE_SLIDE)
        {
          if (imgDir != wxEmptyString)
          {
            MathCell *copy = tmp->Copy(false);
            (*imgCounter)++;
            wxString image = filename + wxString::Format(wxT("_%d.png"), *imgCounter);
            wxString file = imgDir + wxT("/") + image;

            Bitmap bmp;
            bmp.SetData(copy);

            if (!wxDirExists(imgDir))
              if (!wxMkdir(imgDir))
                continue;

            if (bmp.ToFile(file))
              str += wxT("\\includegraphics[width=9cm]{") +
                  filename + wxT("_img/") + image + wxT("}");
          }
          else
            str << wxT("\n\\verb|<<GRAPHICS>>|\n");
        }

        else if (tmp->GetStyle() == TS_LABEL)
        {
          if (str.Right(13) != wxT("displaystyle\n"))
            str += wxT("\n\\end{math}\n\n\\begin{math}\\displaystyle\n");
          str += wxT("\\parbox{8ex}{\\color{labelcolor}") + tmp->ToTeX(false) + wxT("}\n");
        }

        else
          str += tmp->ToTeX(false);

        tmp = tmp->m_nextToDraw;
      }
      str += wxT("\n\\end{math}\n%%%%%%%%%%%%%%%\n");
    }
  }

  // TITLES, SECTIONS, SUBSECTIONS, TEXT
  else if (GetEditable() != NULL && !m_hide) {
    str = GetEditable()->ToTeX(true);
    switch (GetEditable()->GetStyle()) {
      case TS_TITLE:
        str = wxT("\n\\pagebreak{}\n{\\Huge {\\sc ") + PrepareForTeX(str) + wxT("}}\n");
        str += wxT("\\setcounter{section}{0}\n\\setcounter{subsection}{0}\n");
        str += wxT("\\setcounter{figure}{0}\n\n");
        break;
      case TS_SECTION:
        str = wxT("\n\\section{") + PrepareForTeX(str) + wxT("}\n\n");
        break;
      case TS_SUBSECTION:
        str = wxT("\n\\subsection{") + PrepareForTeX(str) + wxT("}\n\n");
        break;
      default:
        if (str.StartsWith(wxT("TeX:")))
          str = str.Mid(5, str.Length());
        else {
          str = PrepareForTeX(str);
        }
        break;
    }
  }

  return str + MathCell::ToTeX(all);
}
开发者ID:BlackEdder,项目名称:wxmaxima,代码行数:101,代码来源:GroupCell.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetEditor函数代码示例发布时间:2022-05-30
下一篇:
C++ GetEditCtrl函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap