Search found 1195 matches

by mc2r
Fri Mar 23, 2007 5:43 pm
Forum: C++ Development
Topic: wxTextCtrl EVT_TEXT_ENTER adds return
Replies: 5
Views: 1209

Max: Thanks. The problem with that is that EVT_CHAR only takes on argument, the callback. So it acts on the entire frame, not just my console. This means that I have to make sure I don't step on any other toes while I'm handling the keys. But that's okay. It seems there's no other way. I'm not sure...
by mc2r
Fri Mar 23, 2007 12:08 am
Forum: Component Writing
Topic: WxNotebook
Replies: 4
Views: 1288

Hi, I haven't tried this myself, so not sure if it will work but can't you just call wxNotebook::AddPage with the same HtmlWindow for each page? wxNotebook::DeletePage will delete the window associated with the page but wxNotebook::RemovePage should allow you to remove pages/tabs without deleteing t...
by mc2r
Thu Mar 22, 2007 10:56 pm
Forum: C++ Development
Topic: wxTextCtrl EVT_TEXT_ENTER adds return
Replies: 5
Views: 1209

Hi, Not sure if this helps but you could try catching OnChar instead. BEGIN_EVENT_TABLE(ScopeFrame, wxFrame) EVT_CHAR(ID_CONSOLE, ScopeFrame::OnConsoleChar) END_EVENT_TABLE() void ScopeFrame::::OnConsoleChar(wxKeyEvent& event){ if(event.KeyCode() == WXK_RETURN){ // get the last line entered wxString...
by mc2r
Thu Mar 22, 2007 7:33 pm
Forum: C++ Development
Topic: Parsing wxDateSpan
Replies: 3
Views: 676

Hi, just a guess: bool MyDateSpan(const wxString& str, wxDateSpan& ds) { wxDateTime dt; if( dt.ParseDate(str.c_str()) ) { ds.SetYears(dt.GetYear()); // And others ... return true; } // Some error handling return false; } Thanks for the reply, but I don't think this does quite what I am looking for....
by mc2r
Thu Mar 22, 2007 6:40 pm
Forum: C++ Development
Topic: Parsing wxDateSpan
Replies: 3
Views: 676

Parsing wxDateSpan

Before I reinvent the wheel, I thought I'd check and see if anyone is already doing this or if there was something I missed in the docs. I have the need to add some date span to a date, yes I know about wxDateSpan. The rub is that the span will be specified by the user of the app as a string + 1 yea...
by mc2r
Fri Feb 23, 2007 12:45 am
Forum: C++ Development
Topic: wxAutomation Questions (Q2)
Replies: 2
Views: 834

Tim thansk for the reply, I believe that the activeWorkbook in my example should be the same as making the call with the excel object and prepending the "ActiveWorkbook" string. Or am I not understanding things, the wxAutomationObject has me sorely confused. Not that the underlying OLE automation cr...
by mc2r
Thu Feb 22, 2007 11:45 pm
Forum: C++ Development
Topic: wxString or TextCtrl to int
Replies: 2
Views: 738

Not directly but you can convert a wxString to a long, and cast that. wxString numberString = wxT("99"); long number; if(numberString.ToLong(&number)){ number++; // Or cast it to an int or whatever } The online manual isn't the greatest but it covers this. http://www.wxwidgets.org/manuals/stable/wx_...
by mc2r
Thu Feb 22, 2007 10:35 pm
Forum: C++ Development
Topic: wxAutomation Questions (Q2)
Replies: 2
Views: 834

wxAutomation Questions (Q2)

OK I am onto trying to figure out the next stumbling block. I am having problems getting a cell reference from a named range. the VBA code snippet Dim SummaryRange as Range SummaryRange = Range(ActiveWorkbook.Names("Unit1SummaryArea")); The part which is not working is my C++ member function for ret...
by mc2r
Thu Feb 22, 2007 9:34 pm
Forum: C++ Development
Topic: wxAutomation Questions (Q1)
Replies: 1
Views: 763

Ok, I got it working. I wrote a quick VBA sub to print the values of xlCalculationManual and xlCalculationAutomatic and define them as const long in my code. Here is the working function void ExcelAutomationObject::SetCalculation(const bool automatic){ const long xlCalculationManual(-4135); const lo...
by mc2r
Thu Feb 22, 2007 5:39 pm
Forum: C++ Development
Topic: wxAutomation Questions (Q1)
Replies: 1
Views: 763

wxAutomation Questions (Q1)

First time poster, long time lurker. Love the forum and can usually find the answer I'm looking for with a quick search, but I am coming up short here on a couple of wxAutomationObject questions. I am working on porting a VBA application to wxWidgets and c++ (mingw). The application performs some he...