Search found 148 matches

by timg
Tue Sep 30, 2008 5:04 pm
Forum: General Development
Topic: How to display char buffer in a wxTextCtrl?
Replies: 13
Views: 1756

Code: Select all


ID_ResultsBox->Replace(0, qq, wxString::Format("%s",rr));

by timg
Thu Sep 25, 2008 3:17 am
Forum: The Code Dump
Topic: Piece function
Replies: 3
Views: 1855

Maybe you should look at the wxStringTokenizer class. It's built to parse strings like yours.
by timg
Mon Sep 15, 2008 5:13 pm
Forum: wxCode
Topic: Conversion
Replies: 3
Views: 1107

you can do it many ways. Here's one:

Code: Select all


m_grid.SetCellValue(row,col,wxString::Format("%f",A(row,col)));

by timg
Thu Sep 11, 2008 11:33 pm
Forum: wxCode
Topic: Conversion
Replies: 3
Views: 1107

wxGrid.GetCellValue returns a string since the base wxGrid stores its data as strings. If you want to assign the values returned from GetCellValue to an array of doubles, you should do: double temp_val; m_grid.GetCellValue(row,col).ToDouble(&temp_val); A(row,col) = temp_val; When you assign the valu...
by timg
Mon Aug 11, 2008 8:29 pm
Forum: General Development
Topic: To copy a file from an archive to the clipboard
Replies: 3
Views: 809

If it's a .zip file, you could look into wxZipInputStream for reading the data, then just copy it to the clipboard as needed.
by timg
Mon Aug 11, 2008 7:49 pm
Forum: Platform Related Issues
Topic: Excel automation, cell reading problem
Replies: 1
Views: 630

Why not try to get the cell object, then read it's value directly instead of activating it. Like this: wxAutomationObject cell; wxVariant rng[2]; int row, col; row = 1; col = 1; rng[0] = wxVariant(row); rng[1] = wxVariant(col); excelObject.GetObject(cell, "Cells", 2, rng); var=cell.GetProperty("Valu...
by timg
Fri Jul 25, 2008 12:18 am
Forum: C++ Development
Topic: Grid Cleaning
Replies: 1
Views: 402

I think ClearGrid() doesn't do what you think it does. It only clears the cells values, it doesn't delete all the rows. I think you probably want to delete all your current rows rather than clear the grid. Also, you probably want to call wxGrid::ForceRefresh() after you have updated the grid with al...
by timg
Tue Jul 22, 2008 6:41 am
Forum: C++ Development
Topic: How to clear certain rows of a wxGrid? like 1 to 4
Replies: 2
Views: 576

You can use wxGrid::SetColLabelValue(int col, const wxString& value) and wxGrid::SetRowLabelValue(int row, const wxString& value) to change the column and row labels, assuming you are using the plain old wxGrid. Maybe this is enough for you? If you put the column names in the label values, you could...
by timg
Wed Jul 09, 2008 8:57 pm
Forum: C++ Development
Topic: Writting into file...
Replies: 4
Views: 882

If the file is not large, you might find it easier to use wxTextFile to read and modify your file.
by timg
Sat Jun 28, 2008 12:12 am
Forum: C++ Development
Topic: File parsing and loading in C++ with wxWidgets
Replies: 3
Views: 624

What you want to look into is wxTextFile. It works with text files on a line by line basis. Super simple to use: wxString file; wxFileDialog fdlog(this); if(fdlog.ShowModal() != wxID_OK) return; file.Clear(); file = fdlog.GetPath(); wxString str; wxTextFile tfile; tfile.Open(file); str = tfile.GetFi...
by timg
Tue Jun 24, 2008 8:08 pm
Forum: C++ Development
Topic: Communicating between frames/dialogs
Replies: 13
Views: 1069

If you want to pull info out, just do it after ShowModal returns. void BillDia::OpenAdd(wxCommandEvent& event) { MyDialog1 *addBill = new MyDialog1(this); addBill->ShowModal(); mydatastring = addBill->myTextCtrl.GetValue(); } Of course, you might want to check that the user didn't hit the Cancel but...
by timg
Tue Jun 10, 2008 4:37 pm
Forum: C++ Development
Topic: wxAutomationObject
Replies: 3
Views: 864

You can create an AutomationObject from a IDispatch pointer like this:

Code: Select all


wxVariant dpntr;
dpntr = presentation.CallMethod("Slides.Add");
wxAutomationObject slide;
slide.SetDispatchPtr(dpntr);
by timg
Tue Jun 03, 2008 2:28 am
Forum: General Development
Topic: Getting a splitter to fill the whole window
Replies: 2
Views: 732

Did you try:

Code: Select all

fgSizer2->AddGrowableCol(0);
fgSizer2->AddGrowableRow(0);
by timg
Mon May 05, 2008 6:47 pm
Forum: C++ Development
Topic: Load/Save between Excel and WxGrid?
Replies: 3
Views: 1176

If you truly need only the values, you can save your data in a .csv file (comma separated values). Excel can open that.

You can also copy and paste into Excel, but that requires wxAutomation stuff ...