示例#1
0
/*
 * view_setcomplist.
 *
 * We have to separate view_new and view_setcomplist because we need
 * to give the view handle to the complist and the complist handle to the
 * view. So do a view_new to create a null view; then complist_new() to
 * which you pass a view handle. The complist will then register itself
 * with the view by calling this function. During the build of the complist,
 * it will also update us by calling view_additem, so that we can refresh
 * the display.
 *
 * Here we should initialise an outline view of the complist.
 *
 * We also talk to the status bar using SetNames to set the names of
 * the two items.
 */
BOOL
view_setcomplist(VIEW view, COMPLIST cl)
{
    LPSTR both;

    if (view == NULL) {
        return(FALSE);
    }

    /* there can be only one call to this per VIEW */
    if (view->cl != NULL) {
        return(FALSE);
    }

    ViewEnter();

    view->cl = cl;

    /* set names on status bar to root names of left and right trees */
    both = complist_getdescription(cl);
    ViewLeave();                      // LKGHACK
    SetNames(both);
    ViewEnter();                      // LKGHACK
    complist_freedescription(cl, both);

    ViewLeave();

    view_outline(view);
    return TRUE;
}
void
DBOptionsAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("DBOptionsAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("types")) != 0)
        SetTypes(node->AsIntVector());
    if((node = searchNode->GetNode("names")) != 0)
        SetNames(node->AsStringVector());
    if((node = searchNode->GetNode("optBools")) != 0)
        SetOptBools(node->AsIntVector());
    if((node = searchNode->GetNode("optFloats")) != 0)
        SetOptFloats(node->AsDoubleVector());
    if((node = searchNode->GetNode("optDoubles")) != 0)
        SetOptDoubles(node->AsDoubleVector());
    if((node = searchNode->GetNode("optInts")) != 0)
        SetOptInts(node->AsIntVector());
    if((node = searchNode->GetNode("optStrings")) != 0)
        SetOptStrings(node->AsStringVector());
    if((node = searchNode->GetNode("optEnums")) != 0)
        SetOptEnums(node->AsIntVector());
    if((node = searchNode->GetNode("enumStrings")) != 0)
        SetEnumStrings(node->AsStringVector());
    if((node = searchNode->GetNode("enumStringsSizes")) != 0)
        SetEnumStringsSizes(node->AsIntVector());
    if((node = searchNode->GetNode("obsoleteNames")) != 0)
        SetObsoleteNames(node->AsStringVector());
}
示例#3
0
/* view_new
 *
 * create a new view. at this point, we are told the table window handle,
 * and nothing else.
 *
 */
VIEW
view_new(HWND hwndTable)
{
    VIEW view;

    if (!bDoneInit) {
        InitializeCriticalSection(&CSView);
        bDoneInit = TRUE;
    }

    /* alloc the view using HeapAlloc */
    view = (VIEW) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct view));
    if (view == NULL) 
    {
        return NULL;
    }
    /* set the default fields */
    view->hwnd = hwndTable;
    view->cl = NULL;
    view->bExpand = FALSE;
    view->bExpandGuard = FALSE;
    view->ciSelect = NULL;
    view->rows = 0;
    view->pItems = NULL;
    view->pLines = NULL;

    // erase the message in the names field - the central box in the status bar
    SetNames("");
    return(view);
}
示例#4
0
文件: Stmt.cpp 项目: CompuCell3D/VTL
ImportFrom::ImportFrom(class Ast* ast, const location& loc, AstNode* _module,
		AstNode* _names, int level) :
	Stmt(AST_IMPORTFROM, ast, loc), level(level)
{
	SetModule(_module);
	SetNames(_names);
}
示例#5
0
void Tree::FinishCreation()	{

	mRoot->SetSuper(this);
	SetLabelOffset(0);
	if (mParam)	{
		SetNames();
	}
	// mRoot->SortLeavesAlphabetical();
}
示例#6
0
void DeviceToolBar::RegenerateTooltips()
{
#if wxUSE_TOOLTIPS
   SetNames();
   mOutput->SetToolTip(mOutput->GetName() + wxT(" - ") + mOutput->GetStringSelection());
   mInput->SetToolTip(mInput->GetName() + wxT(" - ") + mInput->GetStringSelection());
   mHost->SetToolTip(mHost->GetName() + wxT(" - ") + mHost->GetStringSelection());
   mInputChannels->SetToolTip(mInputChannels->GetName() + wxT(" - ") + mInputChannels->GetStringSelection());
#endif
}
示例#7
0
void CEx27bView::OnLButtonDblClk(UINT nFlags, CPoint point) 
{
	if(m_tracker.HitTest(point) == CRectTracker::hitNothing) return;
	// Activate the object
    CEx27bDoc* pDoc = GetDocument();
	if(pDoc->m_lpOleObj != NULL) {
		LPOLECLIENTSITE pClientSite =
				(LPOLECLIENTSITE) pDoc->GetInterface(&IID_IOleClientSite);
		ASSERT(pClientSite != NULL);
		VERIFY(pDoc->m_lpOleObj->DoVerb(OLEIVERB_OPEN, NULL, pClientSite, 0,
			GetSafeHwnd(), CRect(0, 0, 0, 0)) == S_OK);
		SetNames();
		GetDocument()->SetModifiedFlag();
	}
}
void
AxisRestrictionAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("AxisRestrictionAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("names")) != 0)
        SetNames(node->AsStringVector());
    if((node = searchNode->GetNode("minima")) != 0)
        SetMinima(node->AsDoubleVector());
    if((node = searchNode->GetNode("maxima")) != 0)
        SetMaxima(node->AsDoubleVector());
}
示例#9
0
void CEx27bView::OnEditInsertobject() 
{
	CEx27bDoc* pDoc = GetDocument();
	COleInsertDialog dlg;
	if( dlg.DoModal() == IDCANCEL) return;
    // no addrefs done for GetInterface
	LPOLECLIENTSITE pClientSite =
				(LPOLECLIENTSITE) pDoc->GetInterface(&IID_IOleClientSite);
	ASSERT(pClientSite != NULL);
	pDoc->DeleteContents();
	VERIFY(::OleCreate(dlg.GetClassID(), IID_IOleObject, 
		   OLERENDER_DRAW, NULL, pClientSite, pDoc->m_pTempStgSub, 
		   (void**) &pDoc->m_lpOleObj) == S_OK);
	SetViewAdvise();

	pDoc->m_lpOleObj->DoVerb(OLEIVERB_SHOW, NULL, pClientSite, 0, 
		NULL, NULL); // OleRun doesn´t show it
	SetNames();
	GetDocument()->SetModifiedFlag();
	GetSize();
	pDoc->UpdateAllViews(NULL);
}
示例#10
0
openGL_function_info::
openGL_function_info(const string &line_from_gl_h_in,
                     const string &APIprefix_type,
                     const string &APIsuffix_type):
  m_returnsValue(false),
  m_createdFrom(line_from_gl_h_in),
  m_use_function_pointer(sm_use_function_pointer_mode)
{
  ++sm_numberFunctions;

  //typical line: expectedAPItype  return-type APIENTRY function-name (argument-list);
  string::size_type firstParen, glStart, glEnd,lastParen, argStart, argEnd;
  string::size_type retBegin,retEnd, frontMaterialEnd;
  string name, retType,argList;
  string line_from_gl_h;

  line_from_gl_h=RemoveEndOfLines(line_from_gl_h_in);

  /* first get the the first parentisis of the line */
  firstParen=line_from_gl_h.find_first_of('(');
  lastParen=line_from_gl_h.find_last_of(')');

  /* here is the argument list without parentesis but with spaces and all */
  argStart=line_from_gl_h.find_first_not_of(' ',firstParen+1);
  argEnd=line_from_gl_h.find_last_not_of(' ',lastParen-1);
  argList=line_from_gl_h.substr(argStart,argEnd-argStart+1);

  if(APIprefix_type.empty())
    {
      retBegin=0;
    }
  else
    {
      retBegin=line_from_gl_h.find(APIprefix_type);
      if(retBegin!=string::npos)
        retBegin+=APIprefix_type.length();
      else
        retBegin=0;
    }

  retEnd=line_from_gl_h.find(APIsuffix_type,retBegin);

  if(retEnd==string::npos)
    {
      //unable to find GLAPIENTRY to mark
      //where the return type ends, so we
      //look for gl
      retEnd=line_from_gl_h.find("gl",retBegin);
    }

  retType=line_from_gl_h.substr(retBegin,retEnd-retBegin);


  /* get the function name by looking at the string before the firstParen */
  glStart=line_from_gl_h.find("gl",retEnd);
  glEnd=line_from_gl_h.rfind(' ',firstParen);
  if(glEnd!=string::npos && glEnd>glStart)
    {
      glEnd--;
    }
  else
    {
      glEnd=firstParen-1;
    }

  /* here is the function name */
  name=line_from_gl_h.substr(glStart,glEnd-glStart+1);

  frontMaterialEnd=line_from_gl_h.find(name);
  m_frontMaterial=line_from_gl_h.substr(0,frontMaterialEnd);

  SetNames(name,retType,argList);

  m_newDeclaration=(sm_lookUp.find(function_name())==sm_lookUp.end());
  if(m_newDeclaration)
    {
      sm_lookUp.insert( pair<string,openGL_function_info*>(function_name(),this) );
    }
  else
    {
      // cout << "Warning: " << function_name() << " in already in list, this object will not be added!\n";
    }
}
示例#11
0
void DeviceToolBar::Populate()
{
   DeinitChildren();
   // Hosts
   mHost = new wxChoice(this,
                        wxID_ANY,
                        wxDefaultPosition,
                        wxDefaultSize);

   Add(mHost, 0, wxALIGN_CENTER);

   // Input device
   if( mRecordBitmap == NULL )
      mRecordBitmap = new wxBitmap(theTheme.Bitmap(bmpMic));

   Add(new wxStaticBitmap(this,
                          wxID_ANY,
                          *mRecordBitmap), 0, wxALIGN_CENTER);

   mInput = new wxChoice(this,
                         wxID_ANY,
                         wxDefaultPosition,
                         wxDefaultSize);
   Add(mInput, 0, wxALIGN_CENTER);

   mInputChannels = new wxChoice(this,
                         wxID_ANY,
                         wxDefaultPosition,
                         wxDefaultSize);
   Add(mInputChannels, 0, wxALIGN_CENTER);

   // Output device
   if( mPlayBitmap == NULL )
      mPlayBitmap = new wxBitmap(theTheme.Bitmap(bmpSpeaker));
   Add(new wxStaticBitmap(this,
                          wxID_ANY,
                          *mPlayBitmap), 0, wxALIGN_CENTER);

   mOutput = new wxChoice(this,
                               wxID_ANY,
                               wxDefaultPosition,
                               wxDefaultSize);
   Add(mOutput, 0, wxALIGN_CENTER);




   mHost->Connect(wxEVT_SET_FOCUS,
                 wxFocusEventHandler(DeviceToolBar::OnFocus),
                 NULL,
                 this);
   mHost->Connect(wxEVT_KILL_FOCUS,
                 wxFocusEventHandler(DeviceToolBar::OnFocus),
                 NULL,
                 this);
   mOutput->Connect(wxEVT_SET_FOCUS,
                 wxFocusEventHandler(DeviceToolBar::OnFocus),
                 NULL,
                 this);
   mOutput->Connect(wxEVT_KILL_FOCUS,
                 wxFocusEventHandler(DeviceToolBar::OnFocus),
                 NULL,
                 this);
   mInput->Connect(wxEVT_SET_FOCUS,
                 wxFocusEventHandler(DeviceToolBar::OnFocus),
                 NULL,
                 this);
   mInput->Connect(wxEVT_KILL_FOCUS,
                 wxFocusEventHandler(DeviceToolBar::OnFocus),
                 NULL,
                 this);
   mInputChannels->Connect(wxEVT_SET_FOCUS,
                 wxFocusEventHandler(DeviceToolBar::OnFocus),
                 NULL,
                 this);
   mInputChannels->Connect(wxEVT_KILL_FOCUS,
                 wxFocusEventHandler(DeviceToolBar::OnFocus),
                 NULL,
                 this);

   SetNames();

   RefillCombos();
}