Search found 211 matches

by Frank
Sat Sep 10, 2005 8:00 pm
Forum: C++ Development
Topic: sorting elements
Replies: 3
Views: 1245

Also, you can use the STL. Unfortunately the wxDateTime has no operator<(), since the easiest way to sort with the STL is to use operator< just write your own. bool operator< (const wxDateTime& lhd, const wxDateTime& rhd) { return lhd.IsEarlierThan(rhd); } Now you can use all the algorithms ...
by Frank
Tue Sep 06, 2005 12:55 am
Forum: Compiler / Linking / IDE Related
Topic: Monolithic building as a .dll
Replies: 2
Views: 1097

I'm using the Makefile to bild the Monolithic Static Lib.

I have not tried it, but it should be no problem to do the same with the monolithic DLL Build.

Just make sure, you have this line in your config.vc:

Code: Select all

# What type of library to build? [0,1]
SHARED = 1
by Frank
Sun Aug 28, 2005 2:07 am
Forum: Compiler / Linking / IDE Related
Topic: Namespace trouble
Replies: 3
Views: 1442

Code: Select all

namespace Foo {

BEGIN_EVENT_TABLE( Bar, wxFrame )
...

}
Works with VC 2003
by Frank
Wed Aug 24, 2005 6:13 pm
Forum: General Development
Topic: Syntaxing colorization.
Replies: 2
Views: 1165

Take a look a wxStyledTextCtrl in the contrib directory of your wxWidgets.

Or alternativeley, look at wxCode. There is wxScintilla.

Both are wrappers for Scintilla.
by Frank
Mon Aug 22, 2005 7:35 am
Forum: C++ Development
Topic: which database to a program ?
Replies: 19
Views: 5378

<Nitpick> SQLite 2.x has triggers too. And I'm storing Binary-Data in a SQLite 2.x Database (requieres an encoding/decoding, wich is part of SQLite, binaryDecode/binaryEncode as far as I remember) </Nitpick>
by Frank
Mon Aug 22, 2005 1:33 am
Forum: C++ Development
Topic: Why aren't menu shortcuts underlined?
Replies: 4
Views: 1596

It's not a bug, it's a feature :D When you open the menu by pressing ALT, you get the underline in the Menuitems. It's a setting in Windows. You can disable it, to see the underline when clicking with the mouse too. Edit: I looked up the setting: Right click on your Desktop, go to the page where you...
by Frank
Fri Aug 19, 2005 6:02 pm
Forum: C++ Development
Topic: wxSpinCtrl - How to set max length of text?
Replies: 4
Views: 1840

That's not exacly what I want :) I want the same behavior like wxTextCtrl::SetMaxLength(). Il wrote my own control now. Derived from wxSpinCtrl with the addition of SetMaxLength(): void wxMySpinCtrl::SetMaxLength (int len) { SendMessage((HWND)m_hwndBuddy, EM_SETLIMITTEXT, len, 0); } Not pretty, but ...
by Frank
Fri Aug 19, 2005 12:42 am
Forum: C++ Development
Topic: wxSpinCtrl - How to set max length of text?
Replies: 4
Views: 1840

Yes, I know the SetRange-Thing. But I find it very counter-intuitive, when the user can type eg, 1500 and then without him knowing that's not allowed to truncate it without him realizing it. I want to let him know, that he is only allowed to type in 3 chars. Before he presses the Okay-Button. Since ...
by Frank
Thu Aug 18, 2005 10:42 pm
Forum: C++ Development
Topic: wxSpinCtrl - How to set max length of text?
Replies: 4
Views: 1840

wxSpinCtrl - How to set max length of text?

I wan't the user to entry a number between 1 and 999. I wan't to do this with a wxSpinCtrl. How can I set the max text length, so that the user can enter a maximum of 3 characters?

In a wxTextCtrl I would use SetMaxLength(), but how do I do it in a wxSpinCtrl?
by Frank
Sun Aug 14, 2005 7:17 pm
Forum: C++ Development
Topic: std::getline with wxString?
Replies: 16
Views: 4813

It's not just an operator. It seems wxString is derived from std::string: wxString* test = new wxString; std::string* stdstring = dynamic_cast<std::string*>(test); And no, std::getline is not expecting a char* buffer. It es expecting a std::basic_string<>& The prototype is: template<class charT,...
by Frank
Sun Aug 14, 2005 6:11 pm
Forum: C++ Development
Topic: std::getline with wxString?
Replies: 16
Views: 4813

Hmmm. I just tested this:

Code: Select all

   wxString test;
   std::getline(std::cin, test);
Works just fine.

I have wxUSE_STL and wxUSE_STD_STRING set to 1 in my setup.h.
by Frank
Sun Aug 14, 2005 4:09 pm
Forum: C++ Development
Topic: std::getline with wxString?
Replies: 16
Views: 4813

But... But... You CAN Mix STL with wxString. I do it all the time.

All you have to do is compile wx with wxUSE_STL.
by Frank
Sat Aug 13, 2005 3:15 pm
Forum: Component Writing
Topic: Colored Buttons
Replies: 4
Views: 2644

If you change the foreground/backgroundcolor, WX will make this button ownerdrawn. Then in paints the button so that it looks like windows classic.

So, when you have a XP-Theme for your application, you get a wild mix of some buttons that look correct and some that looks like stoneage. Very ugly.
by Frank
Wed Aug 10, 2005 7:30 pm
Forum: Component Writing
Topic: Colored Buttons
Replies: 4
Views: 2644

Yes:

MyButton->SetForegroundColour(myColor);
MyButton->SetBackgroundColour(myColor);

But... If you use windows with a theme, it looks rather ugly...
by Frank
Mon Aug 01, 2005 7:09 am
Forum: Platform Related Issues
Topic: wxBitmapButton and Windows XP Themes
Replies: 11
Views: 3760

I Created my own Button some Time ago. I derived it from wxButton and used UXTheme to paint it themed (and also to allow a bitmap and text on the same Button), cause I found both wxBitmapButton and a normal wxButton with colored label rather ugly and unprofessional (I'm using a different label-color...