void CDxMonthPicker::ScrollLeft(int nMonthCount)
{
    int nYear = m_dtFirstMonth.GetYear();
    int nMonth = m_dtFirstMonth.GetMonth();
    if (nYear < 100 || (nYear == 100 && nMonth <= 2))
        return;
    int nYearNew = nYear - nMonthCount / 12;
    int nMonthNew = nMonth - nMonthCount % 12;
    if (nMonthNew < 1)
    {
        nMonthNew += 12;
        nYearNew--;
    }
    DXASSERT(nMonthNew >= 1 && nMonthNew <= 12);

    if (m_dtMinRange.GetStatus() == COleDateTime::valid)
    {
        if (nYearNew < m_dtMinRange.GetYear())
        {
            nYearNew = m_dtMinRange.GetYear();
            nMonthNew = m_dtMinRange.GetMonth();
        }

        if (m_dtMinRange.GetYear() == nYearNew)
        {
            if (nMonthNew < m_dtMinRange.GetMonth())
                nMonthNew = m_dtMinRange.GetMonth();
        }
    }

    m_dtFirstMonth.SetDate(nYearNew, nMonthNew, 1);

    Populate();
}
SpectrumPrefs::SpectrumPrefs(wxWindow * parent):
   PrefsPanel(parent)
{
   SetLabel(_("Spectrograms"));         // Provide visual label
   SetName(_("Spectrograms"));          // Provide audible label
   Populate( );
}
Exemple #3
0
// Build tree top down, assigning to older objects.
static void Populate(int iDepth, Node thisNode) {
        if (iDepth<=0) {
                return;
        } else {
                iDepth--;
#		ifdef GC
                  thisNode->left  = GC_NEW(Node0); HOLE();
                  thisNode->right = GC_NEW(Node0); HOLE();
#		else
                  thisNode->left  = calloc(1, sizeof(Node0));
                  thisNode->right = calloc(1, sizeof(Node0));
#		endif
                Populate (iDepth, thisNode->left);
                Populate (iDepth, thisNode->right);
        }
}
ProjectsPrefs::ProjectsPrefs(wxWindow * parent, wxWindowID winid)
:   PrefsPanel(parent, winid,
   /* i18n-hint: (noun) i.e Audacity projects. */
               _("Projects"))
{
   Populate();
}
status_t
ServerIconExportUpdateProcess::RunInternal()
{
	status_t result = B_OK;

	if (NULL == fLocalIconStore || fLocalIconStoragePath.Path() == NULL)
		result = B_ERROR;

	if (IsSuccess(result) && HasOption(SERVER_PROCESS_DROP_CACHE)) {
		result = StorageUtils::RemoveDirectoryContents(fLocalIconStoragePath);
	}

	if (result == B_OK) {
		bool hasData;

		result = HasLocalData(&hasData);

		if (result == B_OK && ShouldAttemptNetworkDownload(hasData))
			result = _DownloadAndUnpack();

		if (IsSuccess(result)) {
			status_t hasDataResult = HasLocalData(&hasData);

			if (hasDataResult == B_OK && !hasData)
				result = HD_ERR_NO_DATA;
		}
	}

	if (IsSuccess(result) && !WasStopped())
		result = Populate();

	return result;
}
      /// <summary>Populates the library from the string library</summary>
      /// <param name="data">Feedback data</param>
      /// <returns>Number of objects found</returns>
      /// <exception cref="Logic::ArgumentNullException">Worker data is null</exception>
      /// <exception cref="Logic::InvalidOperationException">String library is empty</exception>
      UINT  ScriptObjectLibrary::Enumerate(WorkerData* data)
      {
         REQUIRED(data);

         // Ensure string library exists
         if (StringLib.Files.empty())
            throw InvalidOperationException(HERE, L"String library has not been enumerated");

         // Feedback
         data->SendFeedback(Cons::Heading, ProgressType::Operation, 1, L"Generating script objects from language files");

         // Populate
         Clear();
         Populate(data);

         // DEBUG:
         Console << "Discovered " << (int)Objects.size() << " script objects..." << ENDL;
         
         // Feedback number of conflicts
         if (Objects.size() - Lookup.size() > 1)   // Always 1 less in lookup because old [THIS] intentionally removed
            data->SendFeedback(Cons::Error, ProgressType::Error, 2, VString(L"Unable to process %d script objects", Objects.size()-Lookup.size()-1));
         
         // Feedback object count
         data->SendFeedback(ProgressType::Info, 2, VString(L"Loaded %d script objects", Lookup.size()));
         return Lookup.size();
      }
Exemple #7
0
void rvInstance::Restart( void ) {
	if ( gameLocal.isMultiplayer ) {
		Populate();
	} else {
		gameLocal.SpawnMapEntities();
	}
}
   /// <summary>Initializes the property grid.</summary>
   /// <returns></returns>
   BOOL PreferencesPage::OnInitDialog()
   {
      try
      {
         // Create base
	      if (!__super::OnInitDialog())
		      throw Win32Exception(HERE, L"Failed to create dialog base");

	      ClientRect wnd(this);

         // Create property grid
	      if (!Grid.Create(WS_VISIBLE | WS_CHILD, wnd, this, IDC_PROPERTY_GRID))
	         throw Win32Exception(HERE, L"Failed to create Properties Grid");

	      // Grid
         Grid.EnableHeaderCtrl(FALSE);
	      Grid.EnableDescriptionArea();
	      Grid.SetVSDotNetLook();
	      Grid.MarkModifiedProperties();

         // Adjust layout
         AdjustLayout();

         // Populate grid
         Populate();
	      return TRUE;
      }
      catch (ExceptionBase& e) {
         Console.Log(HERE, e);
         return FALSE;
      }
   }
Exemple #9
0
	/**
	*Class constructor that initializes all data members
	*
	*@param name = the name of this entity
	*@param playerNumber = the owner of this block (int, 1 or 2)
	*/
	BlockEntity::BlockEntity(std::string name, std::uint32_t player) : Entity(name), mPlayer(player), mX(0), mY(0), mW(32), mH(32), mRenderer(*TetrominoRender::GetInstance()), mOldX(0), mOldY(0), mCollider(mX, mY, mW, mH), lastDirection(), mState(0), mWasNotified(false)
	{
		InternalAttribute(State, 1, Datum::INTEGER, &mState);
		InternalAttribute(value, 4, Datum::DatumType::INTEGER, mValues);
		InternalAttribute(Player, 1, Datum::DatumType::INTEGER, &mPlayer);

		if (mPlayer == 1)
		{
			int num = p1LeftBound;
			InternalAttribute(LeftXBound, 1, Datum::DatumType::INTEGER, &num);
			int num2 = p1RightBound;
			InternalAttribute(RightXBound, 1, Datum::DatumType::INTEGER, &num2);
			int num3 = bottomBounds;
			InternalAttribute(BottomBound, 1, Datum::DatumType::INTEGER, &num3);
		}
		else
		{
			int num = p2LeftBound;
			InternalAttribute(LeftXBound, 1, Datum::DatumType::INTEGER, &num);

			int num2 = p2RightBound;
			InternalAttribute(RightXBound, 1, Datum::DatumType::INTEGER, &num2);
			int num3 = bottomBounds;
			InternalAttribute(BottomBound, 1, Datum::DatumType::INTEGER, &num3);
		}
		Event<EventMessageAttributed>::Subscribe(this);
		blocks.push_back(this);
		Populate();
		auto& colorDatum = (*this)["BlockColor"];
		colorDatum.SetType(Datum::DatumType::STRING);
		colorDatum = std::string("Green");
	}
CDxMonthPicker::CDxMonthPicker()
{
    m_monthPicker = NULL;

    m_mouseMode = mouseNothing;
    m_nTimerID = 0;
    m_bSelectWeek = FALSE;

    m_clrControlBack = RGB(255,255,255);

    m_nFirstDayOfWeek = 2;
    m_nFirstWeekOfYearDays = 1;
    m_dtToday = COleDateTime::GetCurrentTime();
    m_dtFirstMonth.SetDate(m_dtToday.GetYear(), m_dtToday.GetMonth(), 1);
    m_dtMinRange.SetStatus(COleDateTime::null);
    m_dtMaxRange.SetStatus(COleDateTime::null);

    m_rcControl.SetRectEmpty();
    m_rcGrid.SetRectEmpty();

    m_btnToday = NULL;
    m_bYearsTriangle = TRUE;
    m_btnCaptured = NULL;

    AddButton();

    m_arMonthNames     = new CString[12];
    m_arDayOfWeekNames = new CString[7];

    InitNames();
    Populate();
}
	Sector::Sector()
		: mName(), mWorld(nullptr)
	{
		AddExternalSignature("name", 1, &mName);
		CreateTableDatum("entities");
		Populate();
	}
void* CentralFreeList::FetchFromSpansSafe() {
  void *t = FetchFromSpans();
  if (!t) {
    Populate();
    t = FetchFromSpans();
  }
  return t;
}
Exemple #13
0
void CSimpleReport::RowDelete()
{
	int idx = RowGetFocused();
	GetRecords()->RemoveAt(idx);
	Populate();
	SetFocusedRow(GetRows()->GetAt(idx));
	SetFocus();
}
SmartRecordPrefs::SmartRecordPrefs(wxWindow * parent) :
   PrefsPanel(parent)
{
   SetLabel(_("Smart Recording"));         // Provide visual label
   SetName(_("Smart Recording"));          // Provide audible label
  
   Populate();
}
Exemple #15
0
 BOOL Populate(int csidl = CSIDL_DESKTOP)
 {
     CPidl pidl;
     if( FAILED( ::SHGetSpecialFolderLocation(NULL, csidl, &pidl) ) ) return FALSE;
     CComPtr<IShellFolder> spDesktop;
     if( FAILED( ::SHGetDesktopFolder(&spDesktop) ) ) return FALSE;
     return Populate(spDesktop, pidl, csidl == CSIDL_DESKTOP ? NULL : (LPCITEMIDLIST)pidl);
 }
HouseholderListDialog::HouseholderListDialog(QWidget *parent) :	QDialog(parent), ui(new Ui::HouseholderListDialog), model(nullptr)
{
	ui->setupUi(this);
	connect(&client,SIGNAL(HouseholderListReturn(HouseholderList)),this,SLOT(Populate(HouseholderList)));
	connect(&client,SIGNAL(StatusMessage(QString)),this,SIGNAL(StatusMessage(QString)));
	connect(ui->tblHouseholders,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(VerifySelection(QModelIndex)));
	ui->tblHouseholders->setSelectionBehavior(QAbstractItemView::SelectRows);
}
Exemple #17
0
ThemePrefs::ThemePrefs(wxWindow * parent) :
   PrefsPanel(parent)
{
   SetLabel(_("Theme"));         // Provide visual label
   SetName(_("Theme"));          // Provide audible label
  
   Populate();
}
Exemple #18
0
QualityPrefs::QualityPrefs(wxWindow * parent):
   PrefsPanel(parent)
{
   SetLabel(_("Quality"));         // Provide visual label
   SetName(_("Quality"));          // Provide audible label
   mSampleRates = NULL;            // Pointers to controls.
   mOtherSampleRate = NULL;
   Populate( );
}
Exemple #19
0
/**
 * Interface Sub-Menu, to list extras interface and skins
 **/
QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
{
    vector<vlc_object_t *> objects;
    vector<const char *> varnames;
    varnames.push_back( "intf-add" );
    objects.push_back( VLC_OBJECT(p_intf) );

    return Populate( p_intf, current, varnames, objects );
}
BatchCommandDialog::BatchCommandDialog(wxWindow * parent, wxWindowID id):
   wxDialog(parent, id, _("Select Command"),
            wxDefaultPosition, wxSize(250,200),
            wxDIALOG_MODAL | wxCAPTION | wxTHICK_FRAME)
{
   SetLabel(_("Select Command"));         // Provide visual label
   SetName(_("Select Command"));          // Provide audible label
   Populate();
}
PyObject * InventoryItem::ItemGetInfo()
{
    Rsp_ItemGetInfo result;

    if(!Populate(result.entry))
        return NULL;    //print already done.

    return(result.Encode());
}
TracksPrefs::TracksPrefs(wxWindow * parent)
:  PrefsPanel(parent, _("Tracks"))
{
   // Bugs 1043, 1044
   // First rewrite legacy preferences
   gPrefs->Write(wxT("/GUI/DefaultViewModeNew"),
      (int) WaveTrack::FindDefaultViewMode());

   Populate();
}
MacroCommandDialog::MacroCommandDialog(wxWindow * parent, wxWindowID id):
   wxDialogWrapper(parent, id, _("Select Command"),
            wxDefaultPosition, wxDefaultSize,
            wxCAPTION | wxRESIZE_BORDER)
   , mCatalog( GetActiveProject() )
{
   SetLabel(_("Select Command"));         // Provide visual label
   SetName(_("Select Command"));          // Provide audible label
   Populate();
}
KeyConfigPrefs::KeyConfigPrefs(wxWindow * parent)
:  PrefsPanel(parent, _("Keyboard")),
   mView(NULL),
   mKey(NULL),
   mFilter(NULL),
   mFilterTimer(this, FilterTimerID),
   mFilterPending(false)
{
   Populate();
}
Exemple #25
0
/**
 * Insert (or update) an entry in the store.
 * @param now the current time
 * @param entry the entry to insert
 * @returns SLP_OK, INVALID_UPDATE or SCOPE_NOT_SUPPORTED.
 */
slp_error_code_t SLPStore::Insert(const TimeStamp &now,
                                      const ServiceEntry &service,
                                      bool fresh) {
  ServiceMap::iterator iter = m_services.find(service.service_type());
  if (iter == m_services.end())
    iter = Populate(now, service.service_type());
  else
    MaybeCleanURLList(now, iter->second);
  return InsertOrUpdateEntry(&(iter->second->services), service, fresh);
}
Exemple #26
0
void ToolBar::ReCreateButtons()
{
   // SetSizer(NULL) detaches mHSizer and deletes it.
   // Do not use Detach() here, as that attempts to detach mHSizer from itself!
   SetSizer( NULL );

   // Get rid of any children we may have
   DestroyChildren();

   // Create the main sizer
   wxBoxSizer *ms = new wxBoxSizer( wxHORIZONTAL );

   // Create the grabber and add it to the main sizer
   mGrabber = new Grabber( this, mType );
   ms->Add( mGrabber, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP | wxRIGHT, 1 );

   // Use a box sizer for laying out controls
   mHSizer = new wxBoxSizer( wxHORIZONTAL );
   ms->Add( mHSizer, 1, wxEXPAND );

   // (Re)Establish dock state
   SetDocked( GetDock(), false );

   // Go add all the rest of the gadgets
   Populate();

   // Add some space for the resize border
   if( IsResizable() )
   {
      mSpacer = ms->Add( RWIDTH, 1 );
   }

   // Set the sizer
   SetSizerAndFit( ms );

   // Recalculate the height to be a multiple of toolbarSingle
   const int tbs = toolbarSingle + toolbarGap;
   wxSize sz = GetSize();
   sz.y = ( ( ( sz.y + tbs ) / tbs ) * tbs ) - 1;

   // Set the true AND minimum sizes and do final layout
   if(IsResizable())
   {
      sz.SetWidth(GetMinToolbarWidth());
      SetMinSize(sz);
      sz.SetWidth(GetInitialWidth());
      SetSize(sz);
   }
   else
   {
      SetInitialSize(sz);
   }
   Layout();
}
void typeCheckerAndPrint(tree tr)
{
    currMax = 1;
    scope = 1;
    dummy = 0;
    table = createHashTable(); 
    strcpy(mapV[1],"_main");  
    param = &dummy;
    Populate(tr,0); //Start from this function. 
    printHashTable(table);
}
void typeChecker(tree tr)
{
    currMax = 1;
    scope = 1;
    dummy = 0;
    table = createHashTable(); 
    strcpy(mapV[1],"_main");  
    param = &dummy;
    Populate(tr,1); //Start from this function. 
    typeCheck(tr); //Then this one.
}
Exemple #29
0
 ::HRESULT __stdcall ContextMenu::QueryContextMenu (
     ::HMENU menu, ::UINT index, ::UINT first, ::UINT last, ::UINT flags
     )
 {
     w32::gdi::Menu context(w32::gdi::Menu::proxy(menu));
     if ( (flags & (CMF_NORMAL|CMF_EXPLORE)) != 0 ) {
         ::UINT items = Populate(context,index,first,last);
         return (MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_NULL,items));
     }
     return (MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_NULL,0));
 }
Exemple #30
0
nuiFileList::nuiFileList(const nglPath& rPath)
    : nuiList(nuiVertical),
      mFileListSink(this)
{
    SetObjectClass(_T("nuiFileList"));
    nuiLabel* pLabel = new nuiLabel(_T(".."));
    pLabel->SetProperty(_T("Path"), rPath.GetParent().GetAbsolutePath().GetPathName());

    Populate(rPath);
    mFileListSink.Connect(Activated, &nuiFileList::Selected, this);
}