TechSlider

A forum for exporter development discussion.
Post Reply
10 posts • Page 1 of 1
User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

TechSlider

Post by dougal2 » Sun Apr 29, 2007 10:53 am

I'm having problems changing the StaticText to a wxTextCtrl() so that numbers can be entered manually.

Or rather, I've changed it OK, but setting up the event handlers in TechSlider() is going nowhere fast, because of
a) BEGIN_EVENT_TABLE(class, parent)
requires that the TechSlider class be based upon some wx class or something, which it currently isn't. (ie, what to set parent to?)

b) I'm getting errors using text.GetValue() - compiler says that it's undeclared.


Anyone want to help me on this?

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Thu May 03, 2007 6:06 am

hmm... so that's a "no" then?

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Thu May 03, 2007 6:09 am

I'd want, but I can't programm at all ;)

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Thu May 03, 2007 6:15 am

i've just looked at the post date - only 4 days ago!
I thought it was longer than that :? :? :? ok nevermind, I'll let this thread stew a bit longer.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Thu May 03, 2007 6:37 am

lol, ok

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Mon May 07, 2007 11:45 am

ok, i now want to resolve this issue...

basically what I'm trying to implement is the event handler from pressing the return key in the wxTextCtrl so that a user-entered value updates the slider value.

It seems impossible to have the EVENT_TABLE in the TechSlider class for some reason...

however the events do get passed back up the control hierarchy to MainWindow, and using
EVT_TEXT_ENTER(wxID_ANY, MainWindow::onTxtEnter)
works.
The trouble is, that the generated wxCommandEvent contains an ID for the wxTextCtrl only, and there's no association between the TechSlider class that created it, or the wxSlider control that is also in that class. Therefore, we can't update the slider value - or can we?

HELP!

User avatar
zsouthboy
Posts: 1395
Joined: Fri Oct 13, 2006 5:12 am

Post by zsouthboy » Mon May 07, 2007 12:42 pm

I've never used wxwidgets before, but this sounds like it belongs on their forum. :)

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Mon May 07, 2007 10:50 pm

I guess it probably does, althought I think Ono wrote the TechSlider class.

User avatar
OnoSendai
Developer
Posts: 6243
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Mon May 07, 2007 11:56 pm

Techslider is just a kind of wrapper class, it doesn't inherit from any of the wx classes IIRC.

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Tue May 08, 2007 12:31 am

OnoSendai wrote:Techslider is just a kind of wrapper class, it doesn't inherit from any of the wx classes IIRC.
it does now ;)

Code: Select all

TechSlider::TechSlider(const std::string& label, wxWindow* parent, wxSizer* parent_sizer, float min_val_, float max_val_, float default_val_)
					   
    :   wxBoxSizer(wxHORIZONTAL),
        min_val(min_val_),
	    max_val(max_val_),
	    default_val(default_val_)

but still, the event handling doesn't work.

Post Reply
10 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests