示例#1
0
void CCursor::SetParam(const CVariant& v, 
                       const CDBParamVariant& param)
{
    if (param.IsPositional()) {
        // Decrement position by ONE.
        GetCursorCmd()->GetBindParams().Set(param.GetPosition() - 1, v.GetData());
    } else {
        GetCursorCmd()->GetBindParams().Set(param, v.GetData());
    }
}
示例#2
0
IResultSet* CCursor::Open()
{
    CResultSet *ri = new CResultSet(m_conn, GetCursorCmd()->Open());
    ri->AddListener(this);
    AddListener(ri);
    return ri;
}
示例#3
0
IWriter* CCursor::GetBlobWriter(unsigned int col,
                                size_t blob_size, 
                                TBlobOStreamFlags flags)
{
    // Delete previous writer
    delete m_wr;
    m_wr = 0;

    m_wr = new CxBlobWriter(GetCursorCmd(),
                            col - 1,
                            blob_size,
                            flags);
    return m_wr;
}
示例#4
0
CNcbiOstream& CCursor::GetBlobOStream(unsigned int col,
                                      size_t blob_size, 
                                      TBlobOStreamFlags flags,
                                      size_t buf_size)
{
    // Delete previous ostream
    delete m_ostr;
    m_ostr = 0;

    m_ostr = new CWStream(new CxBlobWriter(GetCursorCmd(),
                                           col - 1,
                                           blob_size,
                                           flags), 
                          buf_size, 0, (CRWStreambuf::fOwnWriter |
                                        CRWStreambuf::fLogExceptions));
    return *m_ostr;
}
示例#5
0
/*--------------------------------------------------------------------------*\
 *  void plD_esc_wxwidgets( PLStream *pls, PLINT op, void *ptr )
 *
 *  Handler for several escape codes. Here we take care of filled polygons,
 *  XOR or copy mode, initialize device (install dc from outside), and if
 *  there is freetype support, rerendering of text.
\*--------------------------------------------------------------------------*/
void plD_esc_wxwidgets( PLStream *pls, PLINT op, void *ptr )
{
  // Log_Verbose( "plD_esc_wxwidgets(op=%d, ptr=%x)", op, ptr );

  wxPLDevBase* dev = (wxPLDevBase*)pls->dev;

  switch (op) {

  case PLESC_FILL:
    fill_polygon( pls );
    break;

	case PLESC_XORMOD:
		/* switch between wxXOR and wxCOPY */
    /* if( dev->ready ) {
			if( dev->m_dc->GetLogicalFunction() == wxCOPY )
				dev->m_dc->SetLogicalFunction( wxXOR );
			else if( dev->m_dc->GetLogicalFunction() == wxXOR )
				dev->m_dc->SetLogicalFunction( wxCOPY );
		} */
		break;

	case PLESC_DEVINIT:
    dev->SetExternalBuffer( ptr );

    /* replay begin of page call and state settings */
  	plD_bop_wxwidgets( pls );
    break;

  case PLESC_HAS_TEXT:
    if( !(dev->ready) )
      install_buffer( pls );

    if( dev->freetype ) {
#ifdef HAVE_FREETYPE
      plD_render_freetype_text( pls, (EscText *)ptr );
#endif
    } else
      dev->ProcessString( pls, (EscText *)ptr );
    break;

  case PLESC_RESIZE:
  	{
    	wxSize* size=(wxSize*)ptr;
    	wx_set_size( pls, size->GetWidth(), size->GetHeight() );
		}
    break;

	case PLESC_CLEAR:
		if( !(dev->ready) )
			install_buffer( pls );
		/* Since the plot is updated only every MAX_COMCOUNT commands (usually 5000)
			 before we clear the screen we need to show the plot at least once :) */
		if( !(dev->resizing) && dev->ownGUI ) {
				wxRunApp( pls, true );
				dev->comcount=0;
		}
		dev->ClearBackground( pls->cmap0[0].r, pls->cmap0[0].g, pls->cmap0[0].b,
													pls->sppxmi, pls->sppymi, pls->sppxma, pls->sppyma );
		break;

  case PLESC_GETC:
    if( dev->ownGUI )
      GetCursorCmd( pls, (PLGraphicsIn *) ptr );
	  break;

  case PLESC_GETBACKEND:
    *((int*)ptr) = dev->backend;
	  break;

  default:
    break;
  }
}
示例#6
0
void CCursor::Update(const string& table, const string& updateSql) 
{
    GetCursorCmd()->Update(table, updateSql);
}
示例#7
0
void CCursor::Cancel()
{
    if( GetCursorCmd() != 0 )
        GetCursorCmd()->Close();
}
示例#8
0
void CCursor::Delete(const string& table)
{
    GetCursorCmd()->Delete(table);
}