Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » GetType() ???
GetType() ??? [message #1945] Tue, 28 March 2006 16:04 Go to next message
jchaves13 is currently offline  jchaves13
Messages: 6
Registered: March 2006
Location: Brasil
Promising Member
I want get type of Widget (EditField, EditDate, DocEdit...), but no found way to do.
Re: GetType() ??? [message #1947 is a reply to message #1945] Tue, 28 March 2006 17:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jchaves13 wrote on Tue, 28 March 2006 09:04

I want get type of Widget (EditField, EditDate, DocEdit...), but no found way to do.


Best you can do is to use RTTI...

May I ask why you need that? Perhaps there is a better way how to solve the problem.

Mirek
Re: GetType() ??? [message #1948 is a reply to message #1947] Tue, 28 March 2006 17:27 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
What Ctrl::Name() supposed to do? I think it's possible to get something useful about Ctrl's?
Re: GetType() ??? [message #1949 is a reply to message #1947] Tue, 28 March 2006 17:44 Go to previous messageGo to next message
jchaves13 is currently offline  jchaves13
Messages: 6
Registered: March 2006
Location: Brasil
Promising Member
I have created a mechanism, with KeyHook(), that (like console apps) when the user hit <ENTER> key, the focus move to next ctrl, but in some ctrl (like DocEdit) I want ignore that action.
After post the question, I make some tests with HotKey() instead of KeyHook(), and get better results, for this case. But, I believe that is a good thinks know this.

Thanks, and sorry my bad english.
Re: GetType() ??? [message #1950 is a reply to message #1948] Tue, 28 March 2006 17:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Tue, 28 March 2006 10:27

What Ctrl::Name() supposed to do? I think it's possible to get something useful about Ctrl's?


Name is more or less diagnostic tool - the purpose is to give some meaningful info about Ctrl. Included is classname obtained by RTTI, however, format of this is platform specific - I would not bet portability of my code on that.

Mirek
Re: GetType() ??? [message #1951 is a reply to message #1949] Tue, 28 March 2006 18:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jchaves13 wrote on Tue, 28 March 2006 10:44

I have created a mechanism, with KeyHook(), that (like console apps) when the user hit <ENTER> key, the focus move to next ctrl, but in some ctrl (like DocEdit) I want ignore that action.
After post the question, I make some tests with HotKey() instead of KeyHook(), and get better results, for this case. But, I believe that is a good thinks know this.



Well, for such case I would recommend to use dynamic_cast, like

Ctrl *q = ....
if(dynamic_cast<DocEdit *>(q)) {
// ... q is (or is derived from) DocEdit
}

Anyway, U++ keyboard routing is specifically designed in a way that should make similar tasks quite easy - that is perhaps why you have succeded with HotKey, that is the right way.

Mirek
Re: GetType() ??? [message #1952 is a reply to message #1948] Tue, 28 March 2006 18:00 Go to previous messageGo to next message
jchaves13 is currently offline  jchaves13
Messages: 6
Registered: March 2006
Location: Brasil
Promising Member
I see this option, but not found one way to extract the exact information, in one obtain:
10EditMinMax|4Date11ConvertDateE...
in other:
9EditField...

The information is present, then I supposed that can get then by a function.

Thanks.
Re: GetType() ??? [message #1953 is a reply to message #1952] Tue, 28 March 2006 18:12 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jchaves13 wrote on Tue, 28 March 2006 11:00

I see this option, but not found one way to extract the exact information, in one obtain:
10EditMinMax|4Date11ConvertDateE...
in other:
9EditField...

The information is present, then I supposed that can get then by a function.

Thanks.




Now I am confused Smile What you are trying to do? Use Ctrl::Name()? (Don't!) What is bad about dynamic_cast approach, if you insist not using normal key routing?

Mirek
Re: GetType() ??? [message #1954 is a reply to message #1951] Tue, 28 March 2006 18:23 Go to previous messageGo to next message
jchaves13 is currently offline  jchaves13
Messages: 6
Registered: March 2006
Location: Brasil
Promising Member
[quote title=luzr wrote on Tue, 28 March 2006 13:00]
jchaves13 wrote on Tue, 28 March 2006 10:44


Anyway, U++ keyboard routing is specifically designed in a way that should make similar tasks quite easy

Mirek


Yes, Qt is very good and very powerfull, but some tasks that I heave tried in Qt (and Gtk) at last 4 years, in 2 weeks with U++, I have obtain better results.

Thanks.
Re: GetType() ??? [message #1955 is a reply to message #1953] Tue, 28 March 2006 18:40 Go to previous message
jchaves13 is currently offline  jchaves13
Messages: 6
Registered: March 2006
Location: Brasil
Promising Member
luzr wrote on Tue, 28 March 2006 13:12


Now I am confused Smile What you are trying to do? Use Ctrl::Name()? (Don't!) What is bad about dynamic_cast approach, if you insist not using normal key routing?

Mirek


Embarassed Sorry, the above message was to replay to fudadmin, about Name(), before the our message about dynamic_cast, but I have clicked "replay" instead "quote".
Previous Topic: how to bind or convert Logc positions to int?
Next Topic: How to change the theme [PARTLY SOLVED...]
Goto Forum:
  


Current Time: Sat Apr 27 18:27:58 CEST 2024

Total time taken to generate the page: 0.02875 seconds