Example #1
0
BOOL CHtmlProperties::Show( CReg *pReg)
{
	EndEdit();

	// Destroy properties list
	GetPropList().Destroy();

	// Lose list items
	GetListCtrl().Destroy();

	// Rebuild header
	GetListCtrl().GetHeader().Destroy();
	GetListCtrl().GetHeader().AddHeaderItem( 120, "Name" );
	GetListCtrl().GetHeader().AddHeaderItem( 120, "Value" );

	if ( pReg == NULL ) 
	{	LoadList();
		RedrawWindow();
		return FALSE;
	} // end if

	// Add variables
	AddKey( pReg, pReg->GetKey( "vars" ) );
	AddKey( pReg, pReg->GetKey( "lvars" ) );
	AddKey( pReg, pReg->GetKey( "dvars" ) );

//	AddDynamic( pReg );

	// Loadup the list
	LoadList();

	RedrawWindow();

	return TRUE;
}
int main() {
	int n;
	LinkList list=NULL,result=NULL;
	scanf("%d",&n);
	InitialList(list,n);
	InitialList(result,0);
	Convert(list,result);
	printf("The List is:");
	LoadList(list);
	printf("The turned List is:");
	LoadList(result);
	return 0;
}
Example #3
0
static void LoadGameList(void)
{
    struct grpfile *fg;
    CACHE1D_FIND_REC *srch, *sidx;

    int32_t i;

    for (i = 0; i<NUMGRPFILES; i++)
    {
        fg = (struct grpfile *)Bcalloc(1, sizeof(struct grpfile));

        fg->name = Bstrdup(internalgrpfiles[i].name);
        fg->crcval = internalgrpfiles[i].crcval;
        fg->size = internalgrpfiles[i].size;
        fg->game = internalgrpfiles[i].game;
        fg->dependency = internalgrpfiles[i].dependency;

        if (internalgrpfiles[i].scriptname)
            fg->scriptname = dup_filename(internalgrpfiles[i].scriptname);

        if (internalgrpfiles[i].defname)
            fg->defname = dup_filename(internalgrpfiles[i].defname);

        fg->next = listgrps;
        listgrps = fg;
    }

    srch = klistpath("/", "*.grpinfo", CACHE1D_FIND_FILE);

    for (sidx = srch; sidx; sidx = sidx->next)
        LoadList(srch->name);

    klistfree(srch);
}
Example #4
0
static void LoadGameList(void)
{
    for (size_t i = 0; i < ARRAY_SIZE(internalgrpfiles); i++)
    {
        grpinfo_t * const fg = (grpinfo_t *)Xcalloc(1, sizeof(grpinfo_t));

        fg->name = Xstrdup(internalgrpfiles[i].name);
        fg->crcval = internalgrpfiles[i].crcval;
        fg->size = internalgrpfiles[i].size;
        fg->game = internalgrpfiles[i].game;
        fg->dependency = internalgrpfiles[i].dependency;

        if (internalgrpfiles[i].scriptname)
            fg->scriptname = dup_filename(internalgrpfiles[i].scriptname);

        if (internalgrpfiles[i].defname)
            fg->defname = dup_filename(internalgrpfiles[i].defname);

        fg->postprocessing = internalgrpfiles[i].postprocessing;

        fg->next = listgrps;
        listgrps = fg;
    }

    CACHE1D_FIND_REC * const srch = klistpath("/", "*.grpinfo", CACHE1D_FIND_FILE);

    for (CACHE1D_FIND_REC *sidx = srch; sidx; sidx = sidx->next)
        LoadList(sidx->name);

    klistfree(srch);
}
ModelBankControl::ModelBankControl(wxWindow* parent, wxWindowID id)
{
	wxLogMessage(wxT("Creating Model Bank Control..."));

	txtName = NULL;
	lblName = NULL;
	btnAdd = NULL;
	btnRemove = NULL;
	btnDisplay = NULL;
	lstBank = NULL;

	if (Create(parent, id, wxDefaultPosition, wxSize(270,280), 0, wxT("ModelBankControlFrame")) == false) {
		wxLogMessage(wxT("GUI Error: Failed to create a window for our ModelBankControl."));
		return;
	}

	//wxListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "listBox")
	//wxListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "listBox")
	//wxButton(wxWindow* parent, wxWindowID id, const wxString& label = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "button")
	//wxTextCtrl(wxWindow* parent, wxWindowID id, const wxString& value = "", const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr)
	//wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "staticText")
	
	lblName = new wxStaticText(this, wxID_ANY, wxT("Name:"), wxPoint(5,15), wxDefaultSize, 0);
	txtName = new wxTextCtrl(this, ID_MODELBANK_NAME, wxEmptyString, wxPoint(40,10), wxDefaultSize, 0, wxDefaultValidator);

	btnAdd = new wxButton(this, ID_MODELBANK_ADD, wxT("Add"), wxPoint(200,10), wxDefaultSize);
	btnRemove = new wxButton(this, ID_MODELBANK_REMOVE, wxT("Remove"), wxPoint(200,40), wxDefaultSize);
	btnDisplay = new wxButton(this, ID_MODELBANK_DISPLAY, wxT("Display"), wxPoint(200,70), wxDefaultSize);
	
	lstBank = new wxListBox(this, wxID_ANY, wxPoint(5,40), wxSize(190,250), 0, NULL, wxLB_SINGLE|wxLB_ALWAYS_SB);

	LoadList();
}
void CSQLiteTestDlg::GoFilter()
{
    int idmake = GetCheckedRadioButton(IDC_FNONE, IDC_MAZDA);

    CString make;
    switch (idmake) {
    case IDC_FORD:
        make = "Ford";
        break;
    case IDC_CHEVY:
        make = "Chevy";
        break;
    case IDC_TOYOTA:
        make = "Toyota";
        break;
    case IDC_MAZDA:
        make = "Mazda";
        break;
    case IDC_FNONE:
    default:
        make = "";
    }

    CString cs;
    if (!make.IsEmpty()) {    
        cs.Format("[Make]=\'%s\'", make);
        //the SQL would look like: "[Make]='Ford'"
    }
    m_cars.SetFilter(cs);
    m_cars.Query();

    LoadList();
}
Example #7
0
void main()
{
	int nMenu = 0;
	LoadList(DATA_FILE_NAME);

	// 메인 이벤트 반복문
	while ((nMenu = PrintUI()) != 0) {
		switch (nMenu)	{
		case 1:		  // Add
			Add();
			break;

		case 2:		  // Search
			Search();
			break;

		case 3:		 // Print all
			PrintAll();
			break;

		case 4:		  // Remove
			Remove();
			break;
		}
	}

	// 종료 전에 파일로 저장하고 메모리를 해제한다.
	SaveList(DATA_FILE_NAME);
	ReleaseList();
}
Example #8
0
bool
CMake::LoadFromCMake(LoadNotifier* notifier)
{
    // Possible types
    static const std::pair<wxString, HelpMap*> types[] = {
        std::make_pair("command", &m_commands),
        std::make_pair("module", &m_modules),
        std::make_pair("property", &m_properties),
        std::make_pair("variable", &m_variables)
        // make_pair("policy", &m_policies)
    };
    static const int typesCount = sizeof(types) / sizeof(types[0]);
    static const int PROGRESS = 90;
    static const int STEP = PROGRESS / typesCount;

    // Foreach all types
    for (int i = 0; i < typesCount; ++i) {
        // Notify??
        if (notifier) {
            // Stop request?
            if (notifier->RequestStop())
                return false;

            notifier->Update(STEP * i);
        }

        // Load
        if ( !LoadList(types[i].first, *types[i].second, notifier, STEP) )
            return false;
    }

    return true;
}
Example #9
0
BOOL CGenPropertyPage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

  CString strDescription = m_strObjectType;
  strDescription += " list";

	int i;
  int * iColOrder = new int [m_iColumnCount];

  // default column order is initial order (ie. 0, 1, 2, 3 etc.)
  for (i = 0; i < m_iColumnCount; i++)
    iColOrder [i] = i;

  App.RestoreColumnConfiguration (strDescription, m_iColumnCount, *m_ctlList,
                                  iColOrder, m_iColWidth, m_last_col, m_reverse);

  for (i = 0; i < m_iColumnCount; i++)
    m_ctlList->InsertColumn(i, m_strColumnHeadings [i], m_iColJust [i], m_iColWidth [i]);

// recover column sequence

  m_ctlList->SendMessage (LVM_SETCOLUMNORDERARRAY, m_iColumnCount, (DWORD) iColOrder);

  LoadList ();
  
  delete [] iColOrder;

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
void plResponderProc::MoveCommand(int oldIdx, int newIdx)
{
    // Move data
    int insertIdx = (newIdx > oldIdx) ? newIdx+1 : newIdx;
    int deleteIdx = (newIdx < oldIdx) ? oldIdx+1 : oldIdx;

    ReferenceTarget *targ = fStatePB->GetReferenceTarget(kStateCmdParams, 0, oldIdx);
    fStatePB->Insert(kStateCmdParams, insertIdx, 1, &targ);
    fStatePB->Delete(kStateCmdParams, deleteIdx, 1);

    ReferenceTarget *wait = fStatePB->GetReferenceTarget(kStateCmdWait, 0, oldIdx);
    fStatePB->Insert(kStateCmdWait, insertIdx, 1, &wait);
    fStatePB->Delete(kStateCmdWait, deleteIdx, 1);

    BOOL oldEnabled = fStatePB->GetInt(kStateCmdEnabled, 0, oldIdx);
    BOOL newEnabled = fStatePB->GetInt(kStateCmdEnabled, 0, newIdx);
    fStatePB->SetValue(kStateCmdEnabled, 0, oldEnabled, newIdx);
    fStatePB->SetValue(kStateCmdEnabled, 0, newEnabled, oldIdx);

    ResponderWait::CmdMoved(fStatePB, oldIdx, newIdx);

    LoadList();

    // Reselect item
    // (This doesn't send the LBN_SELCHANGE message so we do that manually)
    ListBox_SetCurSel(fhList, newIdx);
    ICreateCmdRollups();
}
Example #11
0
void CGenPropertyPage::OnPasteItem() 
  {
CString strContents; 

  if (!GetClipboardContents (strContents, m_doc->m_bUTF_8, false))
    return; // can't do it

  CMemFile f ((unsigned char *) (const char *) strContents, strContents.GetLength ());
  CArchive ar (&f, CArchive::load);
  UINT iCount = 0;

  try
    {
    iCount = m_doc->Load_World_XML (ar, m_iMask | XML_NO_PLUGINS); 
    }
  catch (CArchiveException* e) 
    {
    ::TMessageBox ("There was a problem parsing the XML on the clipboard. "
                     "See the output window for more details");
    e->Delete ();
    }

  if (iCount == 0)
    return;

  // They can no longer cancel the property sheet, the document has changed
  CancelToClose ();
  m_doc->SetModifiedFlag (TRUE);

  // reload the list - we don't know how many were added, and indeed, what they were
  LoadList ();

  } // end of CGenPropertyPage::OnPasteItem
Example #12
0
bool ViewScheduled::keyPressEvent(QKeyEvent *event)
{
    // FIXME: Blackholes keypresses, not good
    if (m_inEvent)
        return true;

    m_inEvent = true;

    if (GetFocusWidget()->keyPressEvent(event))
    {
        m_inEvent = false;
        return true;
    }

    bool handled = false;
    QStringList actions;
    handled = GetMythMainWindow()->TranslateKeyPress("TV Frontend", event,
                                                     actions);

    for (int i = 0; i < actions.size() && !handled; i++)
    {
        QString action = actions[i];
        handled = true;

        if (action == "EDIT")
            edit();
        else if (action == "CUSTOMEDIT")
            customEdit();
        else if (action == "DELETE")
            deleteRule();
        else if (action == "UPCOMING")
            upcoming();
        else if (action == "VIEWSCHEDULED")
            upcomingScheduled();
        else if (action == "DETAILS" || action == "INFO")
            details();
        else if (action == "1")
            setShowAll(true);
        else if (action == "2")
            setShowAll(false);
        else if (action == "PREVVIEW" || action == "NEXTVIEW")
            setShowAll(!m_showAll);
        else if (action == "VIEWCARD")
            viewCards();
        else if (action == "VIEWINPUT")
            viewInputs();
        else
            handled = false;
    }

    if (m_needFill)
        LoadList();

    if (!handled && MythScreenType::keyPressEvent(event))
        handled = true;

    m_inEvent = false;

    return handled;
}
void CSQLiteTestDlg::GoSort()
{
    bool asc = GetCheckedRadioButton(IDC_ASC, IDC_DESC) == IDC_ASC;
    int idsort = GetCheckedRadioButton(IDC_SNONE, IDC_YEAR);
    
    CString sort;
    switch (idsort) {
    case IDC_MAKE:
        sort = "Make";
        break;
    case IDC_MODEL:
        sort = "Model";
        break;
    case IDC_YEAR:
        sort = "Year";
        break;
    case IDC_OWNER:
        sort = "Owner";
        break;
    case IDC_SNONE:
    default:
        sort = "";
    }

    CString cs;
    if (!sort.IsEmpty()) {    
        cs.Format("[%s] %s", sort, (asc) ? "ASC" : "DESC");
        //the SQL sort line looks like: "[Foo] ASC, [Boo] DESC"
    }
    m_cars.SetSort(cs);
    m_cars.Query();

    LoadList();
}
Example #14
0
CPluginList::CPluginList(bool bAutoFill /* = true */) :
m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin), "")
{
    if (bAutoFill)
    {
        LoadList();
    }
}
Example #15
0
void CChatListDlg::OnUpdateCheckList(CCmdUI* pCmdUI) 
{
CString strNewHash = MakeListHash ();

  if (strNewHash != m_strListHash)
     LoadList ();

  pCmdUI->Enable (true);
}  // end of CChatListDlg::OnUpdateNeedSelection
//------------------------------------------------------------------------
//! Overrides OnEditBegin() to provide a CComboBox cell value editor
//!
//! @param owner The list control starting edit
//! @param nRow The index of the row for the cell to edit
//! @param nCol The index of the column for the cell to edit
//! @param pt The position clicked, in client coordinates.
//! @return Pointer to the cell editor to use (NULL if cell edit is not possible)
//------------------------------------------------------------------------
CWnd* CGridColumnTraitCombo::OnEditBegin(CGridListCtrlEx& owner, int nRow, int nCol, CPoint pt)
{
	// Check if the user clicked the cell icon (or the label-column checkbox)
	CRect labelRect;
	if (owner.GetCellRect(nRow, nCol, LVIR_LABEL, labelRect) && !labelRect.PtInRect(pt))
		return CGridColumnTraitImage::OnEditBegin(owner, nRow, nCol, pt);

	// Get position of the cell to edit
	CRect rectCell = GetCellEditRect(owner, nRow, nCol);

	// Create edit control to edit the cell
	//	- Stores the pointer, so elements can be dynamically added later
	m_pComboBox = CreateComboBox(owner, nRow, nCol, rectCell);
	VERIFY(m_pComboBox!=NULL);

	// Add all items to list
	if (m_ComboList.GetSize()>0)
	{
		LoadList(m_ComboList, -1);

		// Guess the currently selected item in the list
		CString item = owner.GetItemText(nRow, nCol);
		int nCurSel = m_pComboBox->FindString(-1, item);
		if (nCurSel!=-1)
			m_pComboBox->SetCurSel(nCurSel);
		else
			m_pComboBox->SetWindowText(item);
	}
	else
	{
		CString item = owner.GetItemText(nRow, nCol);
		m_pComboBox->SetWindowText(item);
	}

	// Adjust the item-height to font-height (Must be done after resizing)
	CRect rectCombo;
	m_pComboBox->GetClientRect(&rectCombo);
	if (rectCombo.Height() < rectCell.Height())
	{
		// Expand to fit cell
		int padding = rectCell.Height() - rectCombo.Height();
		m_pComboBox->SetItemHeight(-1, m_pComboBox->GetItemHeight(-1)+padding);
	}
	else
	if (rectCombo.Height() > rectCell.Height() + ::GetSystemMetrics(SM_CXBORDER))
	{
		// Compress to fit cell
		int margin = rectCombo.Height() - m_pComboBox->GetItemHeight(-1);
		int padding = margin - 2*::GetSystemMetrics(SM_CXEDGE);
		if ((m_pComboBox->GetStyle() & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST)
			padding -= ::GetSystemMetrics(SM_CXEDGE);
		if (padding > 0)
			m_pComboBox->SetItemHeight(-1, m_pComboBox->GetItemHeight(-1)-padding);
	}
	return m_pComboBox;
}
void plResponderProc::LoadState()
{
    fStatePB = (IParamBlock2*)fPB->GetReferenceTarget(kResponderState, 0, fCurState);

    IRemoveCmdRollups();
    LoadList();

    HWND hSwitchCombo = GetDlgItem(fhDlg, IDC_SWITCH_COMBO);
    ComboBox_SetCurSel(hSwitchCombo, fStatePB->GetInt(kStateCmdSwitch));
}
Example #18
0
/* Load the core library */
void LoadCoreLibrary(){
    CreateTypes();

    CreateSymbols();

    LoadMath();
    LoadBool();
    LoadList();
    LoadIO();
}
Example #19
0
void CSubtitleDlDlg::OnParse()
{
    SetStatus(ResStr(IDS_SUBDL_DLG_PARSING));
    if (Parse()) {
        LoadList();
        CString msg;
        msg.Format(IDS_SUBDL_DLG_SUBS_AVAIL, m_list.GetItemCount());
        SetStatus(msg);
    } else {
        SetStatus(ResStr(IDS_SUBDL_DLG_NOT_FOUND));
    }
}
Example #20
0
NoteLog::NoteLog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::NoteLog)
{
    ui->setupUi(this);

    ui->dateTimeEdit_From->setDisplayFormat(TIMESTAMP_FORMAT);
    ui->dateTimeEdit_To->setDisplayFormat(TIMESTAMP_FORMAT);
    ui->dateTimeEdit_From->setDateTime(QDateTime::currentDateTime().addDays(-1));
    ui->dateTimeEdit_To->setDateTime(QDateTime::currentDateTime());
    LoadList();
}
Example #21
0
BOOL CLightWizard::OnInitDialog() 
{
	CDialog::OnInitDialog();

	if (!LoadList())
	{
		CDialog::OnCancel();
		return FALSE;
	}
	for ( int i = 0; i < m_aLights.GetSize(); i++ )
	{
		CLightObj * pLight = (CLightObj *) m_aLights.GetAt(i);
		m_LightList.InsertString(i,pLight->m_csName);
		m_LightList.SetItemData(i, (DWORD_PTR)pLight);
	}

	m_Light1.SetArtType(8);
	m_Light2.SetArtType(8);
	m_Light3.SetArtType(8);

	wFlags = F_BG_GRASS;
	m_Light1.SetDrawFlags(wFlags);
	m_Light2.SetDrawFlags(wFlags);
	m_Light3.SetDrawFlags(wFlags);

	m_cscLightLevel.SetRange(0, 30);
	m_cscLightLevel.SetPos(21);
	CString csValue;
	csValue.Format("%02ld", m_cscLightLevel.GetPos());
	m_csLightValue.SetWindowText(csValue);
	m_csbScrollLight.EnableWindow(false);
	m_LightList.SetCurSel(0);
	OnLightChange();

	CRect rectFrame, rectDlg;
	CWnd* pMainWnd = AfxGetMainWnd();
	if(pMainWnd != NULL)
	{
		pMainWnd->GetClientRect(rectFrame);
		pMainWnd->ClientToScreen(rectFrame);
		GetWindowRect(rectDlg);
		int nXPos = rectFrame.left + (rectFrame.Width() / 2) - (rectDlg.Width() / 2);
		int nYPos = rectFrame.top + (rectFrame.Height() / 2) - (rectDlg.Height() / 2);
		::SetWindowPos(m_hWnd, HWND_TOP, nXPos, nYPos, rectDlg.Width(), rectDlg.Height(), SWP_NOCOPYBITS);
	}
	return TRUE;

}
Example #22
0
// ---------------------------------------------------------------------------------- RHTML_Tag_Menu - Start -
void RHTMLTagMenu::Start(BPoint point, int32 offset, MenuType _menutype, std::vector<BString> &_tags, BString _tag, BString _param)
{
 menutype=_menutype;
 tag=_tag;
 tags=_tags;
 param=_param;
 tag.ToLower();
 param.ToLower();
 Lock();

 if (_menutype==R_TAG_MENU)
  fListView->str = "<";
 if (_menutype==R_PARAM_MENU)
  fListView->str = " ";
 if (_menutype==R_VALUE_MENU)
  fListView->str = "";
 
 LoadList();
 if (fListView->CountItems()>0)
 {
  fListView->sel1=offset-1;
  fListView->sel2=offset;
  
  if (_menutype==R_VALUE_MENU)
   fListView->sel1++;

  SetFeel(B_MODAL_APP_WINDOW_FEEL);
  Activate(true);
  fListView->MakeFocus(true);
  fListView->SetEventMask(B_POINTER_EVENTS);
  float left,top;
  BScreen screen;

  if (screen.Frame().bottom>point.y+221)
   top=point.y+20;
  else
   top=point.y-210;

  if (screen.Frame().right>point.x+Bounds().right+1)
   left=point.x;
  else
   left=point.x-Bounds().right;

  MoveTo(left,top);
 }
 Unlock();
}
Example #23
0
void Conference::OnDelete()
{
	
	CListCtrl *list= (CListCtrl*)GetDlgItem(IDC_CONFLIST);
	POSITION pos = list->GetFirstSelectedItemPosition();
	CString confNum;
	if (pos)
	{
		int i = list->GetNextSelectedItem(pos);
		//Call *pCall = (Call *) list->GetItemData(i);
		confNum=list->GetItemText(i,0);
	}
	if(confNum.GetLength()==0)
		return;

	std::string header = "/oneworld/conf_del?api_token=";
	header+=((CmicrosipDlg*)GetParent())->getToken();
	header+="&confno=";
	header+=(CT2CA)confNum;

#ifdef _DEBUG
	_cprintf("Request: %s\n",header);
#endif

	CInternetSession session;
	CHttpConnection *pConnection = session.GetHttpConnection(_T("89.163.142.253"));
	char result[500];
	CString request(header.c_str());
	CHttpFile *pFile = pConnection->OpenRequest(1,request);
	if(!pFile->SendRequest())
		return;
	pFile->Read((void*)result,500);
	char* status = strchr(result,']'); //checking if data is receive and is parseable
	char* eom = strchr(result,'}');
#ifdef _DEBUG
	_cprintf("Size: %p, %p, %d\n",result, status, (status-result));
#endif
	if(status==NULL)
		result[eom-result+1]='\0';
	else if(status - result < 498)
		result[status - result +2]='\0';
#ifdef _DEBUG
	_cprintf("Result: %s\n",result);
#endif
	LoadList();
}
void CSQLiteTestDlg::OnBnClickedNew()
{
    OnBnClickedClose();

    CFileDialog openFileDlg(false, "sqlite", NULL, OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | 
                OFN_PATHMUSTEXIST,
        "SQLite Database (.sqlite)|*.sqlite||");

    if (openFileDlg.DoModal() != IDCANCEL) {
        m_path = openFileDlg.GetPathName(); 
        if (m_cars.Create(m_path)) {
            m_file_open = true;
            Update();
            LoadList();
        } 
    }
}
void CSQLiteTestDlg::OnBnClickedDel()
{
    int count = m_list.GetSelectedCount();
    if (count > 0) {
        int nItem = m_list.GetNextItem(-1, LVNI_SELECTED);
        if (nItem != -1) {
            m_cars.Move(nItem+1);
            m_cars.Delete();
            m_cars.Query();
            LoadList();

            int count = m_cars.GetCount();
            if (nItem < count && count > 0) {
                m_list.SetItemState(nItem, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
            }
        }
    }
}
Example #26
0
BOOL CSettingGitCredential::OnInitDialog()
{
	ISettingsPropPage::OnInitDialog();

	AdjustControlSize(IDC_CHECK_USEHTTPPATH);

	bool hasLocal = GitAdminDir::HasAdminDir(g_Git.m_CurrentDir);

	m_ctrlUrlList.ResetContent();

	ConfigType::Init();
	AddConfigType(ConfigType::Local, CString(MAKEINTRESOURCE(IDS_SETTINGS_LOCAL)), hasLocal);
	AddConfigType(ConfigType::Global, CString(MAKEINTRESOURCE(IDS_SETTINGS_GLOBAL)));
	AddConfigType(ConfigType::System, CString(MAKEINTRESOURCE(IDS_SETTINGS_SYSTEM)));
	m_ctrlConfigType.SetCurSel(0);

	if (WincredExists())
		((CComboBox*) GetDlgItem(IDC_COMBO_HELPER))->AddString(L"wincred");
	if (WinstoreExists())
		((CComboBox*) GetDlgItem(IDC_COMBO_HELPER))->AddString(GetWinstorePath());
	if (GCMExists())
		((CComboBox*)GetDlgItem(IDC_COMBO_HELPER))->AddString(L"manager");

	SimpleCredentialType::Init();
	AddSimpleCredential(SimpleCredentialType::Advanced, CString(MAKEINTRESOURCE(IDS_ADVANCED)));
	AddSimpleCredential(SimpleCredentialType::None, CString(MAKEINTRESOURCE(IDS_NONE)));
	AddSimpleCredential(SimpleCredentialType::LocalWincred, CString(MAKEINTRESOURCE(IDS_LOCAL_WINCRED)), hasLocal && WincredExists());
	AddSimpleCredential(SimpleCredentialType::LocalWinstore, CString(MAKEINTRESOURCE(IDS_LOCAL_WINSTORE)), hasLocal && WinstoreExists());
	AddSimpleCredential(SimpleCredentialType::LocalGCM, CString(MAKEINTRESOURCE(IDS_LOCAL_GCM)), hasLocal && GCMExists());
	AddSimpleCredential(SimpleCredentialType::GlobalWincred, CString(MAKEINTRESOURCE(IDS_GLOBAL_WINCRED)), WincredExists());
	AddSimpleCredential(SimpleCredentialType::GlobalWinstore, CString(MAKEINTRESOURCE(IDS_GLOBAL_WINSTORE)), WinstoreExists());
	AddSimpleCredential(SimpleCredentialType::GlobalGCM, CString(MAKEINTRESOURCE(IDS_GLOBAL_GCM)), GCMExists());
	AddSimpleCredential(SimpleCredentialType::SystemWincred, CString(MAKEINTRESOURCE(IDS_SYSTEM_WINCRED)), WincredExists());
	AddSimpleCredential(SimpleCredentialType::SystemGCM, CString(MAKEINTRESOURCE(IDS_SYSTEM_GCM)), GCMExists());

	LoadList();

	EnableAdvancedOptions();

	UpdateData(FALSE);
	return TRUE;
}
BOOL CSettingGitCredential::OnInitDialog()
{
	ISettingsPropPage::OnInitDialog();

	CString proj;
	bool hasLocal = g_GitAdminDir.HasAdminDir(m_cmdPath, &proj);
	if (hasLocal)
	{
		CString title;
		this->GetWindowText(title);
		this->SetWindowText(title + _T(" - ") + proj);
	}

	m_ctrlUrlList.ResetContent();

	ConfigType::Init();
	AddConfigType(ConfigType::Local, CString(MAKEINTRESOURCE(IDS_SETTINGS_LOCAL)), hasLocal);
	AddConfigType(ConfigType::Global, CString(MAKEINTRESOURCE(IDS_SETTINGS_GLOBAL)));
	AddConfigType(ConfigType::System, CString(MAKEINTRESOURCE(IDS_SETTINGS_SYSTEM)));
	m_ctrlConfigType.SetCurSel(0);

	if (WincredExists())
		((CComboBox*) GetDlgItem(IDC_COMBO_HELPER))->AddString(_T("wincred"));
	if (WinstoreExists())
		((CComboBox*) GetDlgItem(IDC_COMBO_HELPER))->AddString(GetWinstorePath());

	SimpleCredentialType::Init();
	AddSimpleCredential(SimpleCredentialType::Advanced, CString(MAKEINTRESOURCE(IDS_ADVANCED)));
	AddSimpleCredential(SimpleCredentialType::None, CString(MAKEINTRESOURCE(IDS_NONE)));
	AddSimpleCredential(SimpleCredentialType::LocalWincred, CString(MAKEINTRESOURCE(IDS_LOCAL_WINCRED)), hasLocal && WincredExists());
	AddSimpleCredential(SimpleCredentialType::LocalWinstore, CString(MAKEINTRESOURCE(IDS_LOCAL_WINSTORE)), hasLocal && WinstoreExists());
	AddSimpleCredential(SimpleCredentialType::GlobalWincred, CString(MAKEINTRESOURCE(IDS_GLOBAL_WINCRED)), WincredExists());
	AddSimpleCredential(SimpleCredentialType::GlobalWinstore, CString(MAKEINTRESOURCE(IDS_GLOBAL_WINSTORE)), WinstoreExists());
	AddSimpleCredential(SimpleCredentialType::SystemWincred, CString(MAKEINTRESOURCE(IDS_SYSTEM_WINCRED)), WincredExists());

	LoadList();

	EnableAdvancedOptions();

	UpdateData(FALSE);
	return TRUE;
}
//--------------------------------------------------------------------------
//	功能:初始化
//--------------------------------------------------------------------------
void KUiNewPlayerStartMsg::Initialize()
{
	AddChild(&m_List);
	AddChild(&m_AdvanceList);
	AddChild(&m_NewerBtn);
	AddChild(&m_AdvanceBtn);
	AddChild(&m_Ok);

	char Scheme[256];
	g_UiBase.GetCurSchemePath(Scheme, 256);
	LoadScheme(Scheme);

	LoadList();

	m_NewerBtn.CheckButton(true);
	m_AdvanceBtn.CheckButton(false);
	m_AdvanceList.Hide();
   
	Wnd_AddWindow(this, WL_TOPMOST);
}
Example #29
0
BOOL Conference::OnInitDialog(){
	CDialog::OnInitDialog();	
	CListCtrl *list= (CListCtrl*)GetDlgItem(IDC_CONFLIST);


//CHeaderCtrl* m_npheader = list->GetHeaderCtrl();
//HDITEM pHeaderItem;
//pHeaderItem.mask = HDI_TEXT | HDI_HEIGHT | HDI_FORMAT | HDI_ORDER;
//m_npheader->GetItem(0, &pHeaderItem);
//pHeaderItem.cxy = 40;
//m_npheader->SetItem(0, &pHeaderItem);


	list->SetExtendedStyle( list->GetExtendedStyle() |  LVS_EX_FULLROWSELECT |LVS_EX_GRIDLINES );

	list->InsertColumn(0,Translate(_T("Conference number")),LVCFMT_LEFT, 150);
	list->InsertColumn(1,Translate(_T("Pin")),LVCFMT_LEFT,150);

	LoadList();
	return TRUE;
}
Example #30
0
void Conference::OnBnClickedConfsubmit()
{

	std::string header = "/oneworld/conf_create?api_token=";
	header+=((CmicrosipDlg*)GetParent())->getToken();
	header+="&pin=";
	CString pinNum;
	GetDlgItemText(IDC_CONFPIN,pinNum);
	header+=(CT2CA)pinNum;
	header+="&length=0";
	CInternetSession session;
	CHttpConnection *pConnection = session.GetHttpConnection(_T("89.163.142.253"));
	char result[500];
	CString request(header.c_str());
	CHttpFile *pFile = pConnection->OpenRequest(1,request);
	if(!pFile->SendRequest())
		return;
	pFile->Read((void*)result,500);
	char* status = strchr(result,']'); //checking if data is receive and is parseable
	char* eom = strchr(result,'}');
#ifdef _DEBUG
	_cprintf("Size: %p, %p, %d\n",result, status, (status-result));
#endif
	if(status==NULL)
		result[eom-result+1]='\0';
	else if(status - result < 498)
		result[status - result +2]='\0';
#ifdef _DEBUG
	_cprintf("Result: %s\n",result);
#endif

	cJSON *root = cJSON_Parse(result);
	cJSON *success = cJSON_GetObjectItem(root,"success");

	
#ifdef _DEBUG
	_cprintf("Success: %s\n",success->valuestring);
#endif
	LoadList();
}