Search found 186 matches

by geralds
Fri Mar 31, 2006 11:42 am
Forum: Platform Related Issues
Topic: Printing Sample on Mac and Windows
Replies: 6
Views: 1403

One quick way of testing your printer/computer/wx setup is to switch to wxHtmlEasyPrinting and compare the Windows/Mac output (this only requires a few lines of code and it's certainly much easier than delving into the details of getting dimensions from the printer, drawing the page, etc.). I may be...
by geralds
Fri Mar 24, 2006 9:56 am
Forum: C++ Development
Topic: STC Lexer Help
Replies: 4
Views: 1462

I haven't looked into keywords yet (though I will have to soon: there are quite a few keywords I'd like the syntax highlighter to recognise). Looking at stc.h, your method seems like a good way to go. (I know wxStEdit defines massive lists of keywords in one of its header files. It's probably the be...
by geralds
Thu Mar 23, 2006 1:48 pm
Forum: C++ Development
Topic: STC Lexer Help
Replies: 4
Views: 1462

Here's a very basic example for XML, also taken from the wxStyledTextCtrl-derived component. C++ should be similar. (If you need folding, let me know. It's much easier to do than the documentation suggests.) MyCtrl::MyCtrl(...) { for (int i = wxSTC_H_DEFAULT; i <= wxSTC_H_SGML_BLOCK_DEFAULT; ++i) St...
by geralds
Fri Mar 17, 2006 2:31 pm
Forum: C++ Development
Topic: Folding with wxStyledTextCtrl
Replies: 2
Views: 743

Will do. Many thanks!
by geralds
Fri Mar 17, 2006 2:02 pm
Forum: C++ Development
Topic: ToolBar size and location problem
Replies: 5
Views: 1250

It's a bit of a minefield on Windows I think. The sample toolbar app crashes every time the mouse rolls over a button to the right of the combo box. You could pass your toolbar to a http://www.planet-berlin-it.de/wx/wxcoolbar/ , which takes care of positioning and looks great on XP. The tutorial exp...
by geralds
Fri Mar 17, 2006 1:57 pm
Forum: C++ Development
Topic: Folding with wxStyledTextCtrl
Replies: 2
Views: 743

Folding with wxStyledTextCtrl

Has anyone implemented folding with wxStyledTextCtrl in C++? I'd love to see how it is implemented. Is it the lexer that assigns folding levels to lines, or is this something the application needs to do separately? I'd really appreciate an example of how it's done. (I've read the wxPython instructio...
by geralds
Fri Mar 03, 2006 7:17 pm
Forum: C++ Development
Topic: Catching std exceptions thrown in MyFrame member functions
Replies: 6
Views: 1233

Thanks Avi, yes I did find wxApp::OnExceptionInMainLoop in the end!
by geralds
Fri Mar 03, 2006 2:55 pm
Forum: C++ Development
Topic: Catching std exceptions thrown in MyFrame member functions
Replies: 6
Views: 1233

Yes, I may have to do that and provide a MyFrame::OnCustomException() method. It's a shame though that even if I throw a std exception from there, I can't seem to catch it in MyApp::OnInit.

In short, I'd prefer to use std exceptions, but if I can't that's ok, too.

Thank you very much!
by geralds
Fri Mar 03, 2006 2:03 pm
Forum: C++ Development
Topic: Catching std exceptions thrown in MyFrame member functions
Replies: 6
Views: 1233

Thanks Priyank! That's just it: pretty much everything happens in member functions of MyFrame, so I'd need to add exception handling to all member functions of MyFrame. What's more, all MyFrame::On... functions specified in the event table are void, so I can't return false if a new request for a GUI...
by geralds
Fri Mar 03, 2006 1:43 pm
Forum: C++ Development
Topic: Catching std exceptions thrown in MyFrame member functions
Replies: 6
Views: 1233

Catching std exceptions thrown in MyFrame member functions

The following in MyApp::OnInit only seems to catch errors thrown in the MyFrame constructor. bool MyApp::OnInit() { MyFrame *frame; try { frame = new MyFrame(_T("My Application")); if (!frame) throw runtime_error("Cannot create object of class MyFrame"); frame->Show(true); } catch (bad_alloc) { wxMe...
by geralds
Wed Mar 01, 2006 10:24 am
Forum: C++ Development
Topic: How do i creat XML file
Replies: 3
Views: 923

I think you may find that it's worth using the parsers directly. If you need to write XML, libxml2 is a good first choice. For fast parsing, you can't beat Expat. If you need XML Schema validation, Xerces is your best bet (though libxml2 does handle simple XML Schemas well and has full support for R...
by geralds
Tue Feb 28, 2006 1:00 pm
Forum: C++ Development
Topic: Printing
Replies: 1
Views: 747

I think I'll use wxHtmlEasyPrinting with <br> tags, <, > and &nbsp; instead... It only takes 2 minutes to implement and everything works out of the box!
by geralds
Tue Feb 28, 2006 10:23 am
Forum: C++ Development
Topic: coolbar
Replies: 1
Views: 503

Yes, try Martin Simon's wxCoolBar. (If you're using the Unicode build, you may need to add _T() around some of the string literals.)

http://www.planet-berlin-it.de/wx/wxcoolbar/
by geralds
Mon Feb 27, 2006 1:33 pm
Forum: C++ Development
Topic: Develop an html text editor
Replies: 12
Views: 2781

cecilio, I think you may find that the best option is wxStyledTextCtrl, a Scintilla wrapper.

It's powerful, fast and versatile (check out contrib/samples/stc). Especially if you're considering syntax highlighting/tag completion/folding, you can't beat it...
by geralds
Mon Feb 27, 2006 1:19 pm
Forum: C++ Development
Topic: Printing
Replies: 1
Views: 747

Printing

I'm working on the print setup/print preview/print methods for my main frame and although setup and preview work fine and print doesn't flag up any errors, no output is created. Of course the error may be hidden in the underlying routines (GetPageInfo etc.), but I was wondering if I'm overlooking so...