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 » Developing U++ » UppHub » Knob control
Knob control [message #27950] Wed, 11 August 2010 22:30 Go to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello all

It is included in Controls4U a new Knob control. You can see samples in the picture.

index.php?t=getfile&id=2718&private=0

The interface is preliminar. If you have any advice please tell me asap.

It includes:

- 4 color types: SimpleWhiteType, SimpleBlackType, WhiteType (preliminar), BlackType (preliminar)

- 2 marks: Line and Circle

Angle begin, angle end, min value, max value, step value are programmable.

In addition it is possible to set numbers in marks (SetNumber) and add the possibility of knob locks in marks (SetInterlocking).

The status is:

- Visual style: 70%
- Class methods: 90%
- User input: 95%
- .usc layout designer: 20%
- Documentation: 0%
  • Attachment: dib.PNG
    (Size: 100.76KB, Downloaded 879 times)


Best regards
Iñaki
Re: Knob control [message #27954 is a reply to message #27950] Thu, 12 August 2010 02:44 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hi Koldo

Looks good. I shall 'try' it and 'catch' some points to discuss Very Happy

I'm not sure if you can add fine marks between the major marks. Could be set to 0 if a person does not want them.

Thank you very much

[Updated on: Thu, 12 August 2010 03:20]

Report message to a moderator

Re: Knob control [message #27959 is a reply to message #27954] Thu, 12 August 2010 08:13 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Quote:

I'm not sure if you can add fine marks between the major marks. Could be set to 0 if a person does not want them.

No problem Smile.

Two questions:
- How would you call the marks between major marks?
- How would you call the mark locking knob behavior?


Best regards
Iñaki

[Updated on: Thu, 12 August 2010 08:25]

Report message to a moderator

Re: Knob control [message #27963 is a reply to message #27959] Thu, 12 August 2010 10:11 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

koldo wrote on Thu, 12 August 2010 11:43


Two questions:
- How would you call the marks between major marks?
- How would you call the mark locking knob behavior?

I am thinking more in terms of the slider code I just modified. In that code, the ticks are marked for every minorticks and thick one for every majorticks. The increment is by minorticks.

The knob locks on to minortick increments. Majorticks is just a special case of minorticks as I see it.

This is the relevant part of that code
	// draw gradations	
	for( 	int i = Min(); 
			( m_nMajorTicks > 0 ) && ( i <= Max() ) ;
			i += ( m_nMinorTicks == 0 ? m_nMajorTicks : m_nMinorTicks ) ) {
		
		int nPos = SliderToClient( i );
		
		if( ( m_nMajorTicks != 0 ) && ( i % m_nMajorTicks ) == 0 )
			DrawTick( w, MAJOR, (HOVE)HoVe( HORZ, VERT ), nPos, i );
		else if( ( m_nMinorTicks != 0 ) && ( i % m_nMinorTicks ) == 0 )
			DrawTick( w, MINOR, (HOVE)HoVe( HORZ, VERT ), nPos, i );
	}


Regards
Re: Knob control [message #27965 is a reply to message #27963] Thu, 12 August 2010 10:23 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Quote:

the ticks are marked for every minorticks and thick one for every majorticks. The increment is by minorticks.
Ok

A question: The Knob sensibility and behavior when using it with mouse and keyboard is right for you?. When selected and/or clicked it changes slightly its shape.


Best regards
Iñaki

[Updated on: Thu, 12 August 2010 10:25]

Report message to a moderator

Re: Knob control [message #27967 is a reply to message #27950] Thu, 12 August 2010 13:29 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hi Koldo

Frankly, I haven't been able to check it out as yet. My internet connection is on the blink and downloading 27MB is painful. If I have the changed files log, I can manually download the relevant files and update my src directory.

Cheers
Re: Knob control [message #27990 is a reply to message #27950] Fri, 13 August 2010 06:29 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hi Koldo

I've been able to get the complete package and checked the knob. It looks good. As for the focus behaviour, I think it is perfectly fine to know that the knob is captured.

Best Regards
Re: Knob control [message #28059 is a reply to message #27990] Sat, 14 August 2010 01:55 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Jerson

I have removed SetStep and added SetMinorMarks and SetMajorMarks.

These include what you want and are much safer.

Be careful. SetMajorMarks set the number of major marks excluded the initial and the end. SetMinorMarks includes the number of minor marks between every pair of major marks.

I have changed also how to show the selected Knob. Here the results:

index.php?t=getfile&id=2727&private=0
  • Attachment: dib.PNG
    (Size: 49.89KB, Downloaded 702 times)


Best regards
Iñaki
Re: Knob control [message #28060 is a reply to message #27950] Sat, 14 August 2010 04:04 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hi Koldo

This looks very good. Thank you

Since it is a work in progress, I guess, the USC does not link to the knob properly and I get errors if I try to SetFineTicks(IIRC) and some other parameters too.

Regards

[Updated on: Sat, 14 August 2010 05:09]

Report message to a moderator

Re: Knob control [message #28071 is a reply to message #28060] Sat, 14 August 2010 16:09 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Jerson

Quote:

Since it is a work in progress, I guess, the USC does not link to the knob properly and I get errors if I try to SetFineTicks(IIRC) and some other parameters too.

Yes, .usc is not updated yet, but I do not know what is "SetFineTicks".


Best regards
Iñaki
Re: Knob control [message #28073 is a reply to message #28071] Sat, 14 August 2010 16:58 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

koldo wrote on Sat, 14 August 2010 19:39


Yes, .usc is not updated yet, but I do not know what is "SetFineTicks".

Hi Koldo

You won't believe it, my mind doesn't know anymore what my hand is doing Rolling Eyes The original name I wanted to quote is SetFineStep from the USC file. I renamed it to SetMinorMarks in the .USC file, but then I realised it is not implemented in the CPP file.

Regards
Re: Knob control [message #28078 is a reply to message #28073] Sat, 14 August 2010 21:10 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Jerson

Sorry. You will have today a version with the control look and feel at 100% for the styles implemented today, and .usc coherent with C++.


Best regards
Iñaki
Re: Knob control [message #28114 is a reply to message #28078] Tue, 17 August 2010 10:10 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello all (and specially Jerson)

C++ and .usc will be updated this night so the controls in Layout Designer look similar to real ones.

index.php?t=getfile&id=2735&private=0

Now there is a new SetStyle(), with Rugged as one of the options.

You can try it all with the demo in Controls4U_Demo.

Please check them and propose other names it you do not like actual ones.
  • Attachment: dib.PNG
    (Size: 133.29KB, Downloaded 674 times)


Best regards
Iñaki
Re: Knob control [message #28115 is a reply to message #28114] Tue, 17 August 2010 10:36 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Hi Koldo!
Respect man Smile I remember doing usc paint for GridCtrl.. Esc language is ok but the main trouble is you have to write paint code twice and then maintain it. It would be great if it was possible to use real widgets in designer. I guess FormEditor follows this way.
Re: Knob control [message #28116 is a reply to message #27950] Tue, 17 August 2010 14:16 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hi Koldo

Thanks very much for your efforts. The knobs really look professional grade now. Especially the ones on the row above. I haven't got down to running it on my machine yet as I am severely behind schedule on almost everything. I will definitely add to this post when I check this control. It is very exciting.

Re: Knob control [message #28118 is a reply to message #28115] Tue, 17 August 2010 16:01 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
unodgs wrote on Tue, 17 August 2010 10:36

Hi Koldo!
Respect man Smile I remember doing usc paint for GridCtrl.. Esc language is ok but the main trouble is you have to write paint code twice and then maintain it. It would be great if it was possible to use real widgets in designer. I guess FormEditor follows this way.

Yes Daniel

In fact my focus use to be to do the Paint() function first in .usc and after that in C++. Both are almost the same, but as there is no Painter in .usc I have to emulate some Painter capabilities. The .usc widgets are fully resizable as the Painter ones.

So it would be great to use real widgets in layout designer.

Meanwhile I strongly encourage all contributors to:

- Use Painter
Visual experience is much better Smile

- Create .usc widgets for your classes
If a visual class is not in .usc, it does not exist Sad


Best regards
Iñaki
Re: Knob control [message #28124 is a reply to message #28118] Tue, 17 August 2010 18:22 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi,
I apologize for engaging into slightly off-topic discussion, but I couldn't help it Smile

unodgs wrote on Tue, 17 August 2010 10:36

It would be great if it was possible to use real widgets in designer. I guess FormEditor follows this way.

Unfortunately FormEditor can AFAIK use only widgets that are compiled in. Compiling theide every time you change something in a widget would be tedious. That might or might not be solvable in the future using some plugin-like solution to let the widget to be compiled separately. But in the meantime, I guess it should not be that hard to learn Esc how to use Painter, at least the basic functions.

koldo wrote on Tue, 17 August 2010 16:01

Meanwhile I strongly encourage all contributors to:

- Use Painter
Visual experience is much better Smile

- Create .usc widgets for your classes
If a visual class is not in .usc, it does not exist Sad

I strongly agree with both and join your encouragement Wink

Best regards,
Honza
Re: Knob control [message #28126 is a reply to message #28124] Tue, 17 August 2010 21:17 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello all (and specially Jerson)

Files uploaded and documentation included.

I have improved painting speed by using virtual Layout() to do most of the Painter process, and doing just DrawImage() calls when the user interacts with the control.


Best regards
Iñaki
Re: Knob control [message #28134 is a reply to message #27950] Wed, 18 August 2010 03:30 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hi Koldo

I had a run of the knob in my project. It looks and feels really great. Thank you

Regards
Re: Knob control [message #28135 is a reply to message #27950] Wed, 18 August 2010 08:15 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Smile

Best regards
Iñaki
Previous Topic: Single Threaded RS232
Next Topic: Docking - Saved Layout - Main window size?
Goto Forum:
  


Current Time: Thu Mar 28 13:19:59 CET 2024

Total time taken to generate the page: 0.01076 seconds