TSpinButton, TTimerSpeedButton etc for motion control

Hi,

In my application I have a group of 6 buttons that must control the
movement of a device: Up, Down, Left, Right, Rotate anticlockwise, and
Rotate clockwise. These buttons affect 3 position values: Vertical
Position, Horizontal Position and Angle, and need to be able to display
a custom glyph without a caption text.

The buttons are distributed about a graphic that represents the device
-- they are not grouped as in a TSpinEdit where two are combined with
an edit box. Each pair of buttons affects a TEdit that is positioned
near those buttons, but cannot be attached to the buttons themselves.

I would like these button-pairs to behave like the buttons within a
TSpinEdit. Clicking the Up button would increment Vertical Position and
update the corresponding TEdit, etc. Holding the Up button pressed
would cause succesive increments to the Vertical Position TEdit, as is
done in a TSpinEdit.


My initial idea of using 3 pairs of TBitBtns along with a TTimer and
three TEdits seemed a very long-winded way of achieving this, so I
looked at what else Delphi has and found TSpinButton and
TTimerSpeedButton.

TSpinButton doesn't satisfy the requirement -- it has the two buttons
together.

Looking at TTimerSpeedButton, I can't find any example showing its use.

So, my questions are:

  1) Does anyone have a sample showing the use of the TTimerSpeedButton
component (Vcl.Samples) ?

  2) Does anyone have a sample showing how to use two buttons, a timer
and a TEdit to achieve a "distributed spin edit" ?


All help and assistance gratefully received.

--
JF
0
Jim
8/9/2015 7:40:35 AM
embarcadero.delphi.vcl.using 2297 articles. 1 followers. Follow

4 Replies
314 Views

Similar Articles

[PageSpeed] 46

On 09/08/2015 10:40, Jim Fleming wrote:
> Hi,
>
> In my application I have a group of 6 buttons that must control the
> movement of a device: Up, Down, Left, Right, Rotate anticlockwise, and
> Rotate clockwise. These buttons affect 3 position values: Vertical
> Position, Horizontal Position and Angle, and need to be able to display
> a custom glyph without a caption text.
>
> The buttons are distributed about a graphic that represents the device
> -- they are not grouped as in a TSpinEdit where two are combined with
> an edit box. Each pair of buttons affects a TEdit that is positioned
> near those buttons, but cannot be attached to the buttons themselves.
>
> I would like these button-pairs to behave like the buttons within a
> TSpinEdit. Clicking the Up button would increment Vertical Position and
> update the corresponding TEdit, etc. Holding the Up button pressed
> would cause succesive increments to the Vertical Position TEdit, as is
> done in a TSpinEdit.
>
>
> My initial idea of using 3 pairs of TBitBtns along with a TTimer and
> three TEdits seemed a very long-winded way of achieving this, so I
> looked at what else Delphi has and found TSpinButton and
> TTimerSpeedButton.
>
> TSpinButton doesn't satisfy the requirement -- it has the two buttons
> together.
>
> Looking at TTimerSpeedButton, I can't find any example showing its use.
>
> So, my questions are:
>
>    1) Does anyone have a sample showing the use of the TTimerSpeedButton
> component (Vcl.Samples) ?
>
>    2) Does anyone have a sample showing how to use two buttons, a timer
> and a TEdit to achieve a "distributed spin edit" ?
>
>
> All help and assistance gratefully received.
>
> --
> JF
>

At a time i head a joystick component this is what you need
Try http://www.torry.net/pages.php?id=1552
or search for free joystick on Google
if you cannot find let me know
0
shlomo
8/9/2015 9:29:47 AM
Jim Fleming <jfleming@euskalnet.net> wrote:

>Looking at TTimerSpeedButton, I can't find any example showing its use.
>
>So, my questions are:
>
>  1) Does anyone have a sample showing the use of the TTimerSpeedButton
>component (Vcl.Samples) ?

In D7 at least, it's not a component, just a control defined for use in
code, as the TSpinEdit uses it for buttons. If it hasn't been made into a
component in your Delphi version, you either need to instantiate it in code
and do the extra placement stuff, or make it into a component. That's what
I did, by duplicating the TTimerSpeedButton class and renaming it, removing
the TimeBtnState stuff and registering it as a component.
0
Garth
8/9/2015 9:07:09 PM
Garth,

Sorry for the delay in responding, but with these fora out of order so often 
and this being the holiday period I have not had the oppurtunity to reply.


"Garth Thornton" <garthst@paradise.net.nz.takeaway> escribió en el mensaje 
news:729465@forums.embarcadero.com...
>>  1) Does anyone have a sample showing the use of the TTimerSpeedButton
>>component (Vcl.Samples) ?
>
> In D7 at least, it's not a component, just a control defined for use in
> code, as the TSpinEdit uses it for buttons. If it hasn't been made into a
> component in your Delphi version, you either need to instantiate it in 
> code
> and do the extra placement stuff, or make it into a component. That's what
> I did, by duplicating the TTimerSpeedButton class and renaming it, 
> removing
> the TimeBtnState stuff and registering it as a component.

Would it be possible for you to either post your component code on 
attachments, or send it to me direct via email (see below). Even if it was 
for D7 it would be a useful starting point for building a component for D 
XE6.

--
JF

jfleming
at
euskalnet
dot
net
0
Jim
8/17/2015 6:28:56 PM
Jim Fleming <jfleming@euskalnet.net> wrote:

>"Garth Thornton" <garthst@paradise.net.nz.takeaway> escribió en el mensaje 
>news:729465@forums.embarcadero.com...
>>>  1) Does anyone have a sample showing the use of the TTimerSpeedButton
>>>component (Vcl.Samples) ?
>>
>> In D7 at least, it's not a component, just a control defined for use in
>> code, as the TSpinEdit uses it for buttons. If it hasn't been made into a
>> component in your Delphi version, you either need to instantiate it in 
>> code
>> and do the extra placement stuff, or make it into a component. That's what
>> I did, by duplicating the TTimerSpeedButton class and renaming it, 
>> removing
>> the TimeBtnState stuff and registering it as a component.
>
>Would it be possible for you to either post your component code on 
>attachments, or send it to me direct via email (see below). Even if it was 
>for D7 it would be a useful starting point for building a component for D 
>XE6.

I'll email it, as I have it in a unit with other components. It's very
simple without the TimeBtnState and paint method override. And since it's
derived from TSpeedButton, you shouldn't need to change anything for XE6.
0
Garth
8/17/2015 11:07:23 PM
Reply:

Similar Artilces:

What control do I use (or do I not use a control at all...)
Okay so here's the story so far. I am making a blog to be incorporated into a website. Well, I'm doing the blog from scratch. I'm using MySQL to source all the data via MySQL .NET/Connector. Now while developing the script, I used DataReader and Response.Write to show the blog topics. Now that it has come to put it under a design (I'm using a Master Page for that), I've hit the problem. Response.Write shows all the topics before any of the design elements could be incorporated. So that (more or less) is out of question. So next I looked into the data presentation controls. I looked up GridVi...

using a .Net Control as activex control in VCL form
Hi , We have a to integrate a simple .Dot CSharp control which needs to be integrated into bcb2010 VCL form as a control. We will place the control on the VCL form along with other VCL controls's. I tried creating a simple .net control using a lable+textbox and trying to use in vcl form. I have made the assembly comvisible and generated tlb files and .bpl for the component. I could see the component in "ActiveX" tool palette. But when I drag the object onto VCL form and try to access its attributes I run into problems. I am not able to see .net control on the vcl at runti...

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

Using Data Controls Without Using ObjectDataSource Control
Hi, I've been looking on the Internet for a tutorial that would show me how to use the data conrols (FormView, GridView etc) without using an ObjectDataSource (or any other data source control).  The reason is that I want to use a formview and gridview from within another formview control to create a single form  that would allow me to insert, update and delete an order and its order details at the same time. I thought that this could be achieved by having a DataSet containing two DataTable objects in the code-behind with the Order DataTable containing one row to repres...

To use or not to use Delphi
Sadly, it seems to me that there is a sort of race between the two threads, for and against using Delphi in new projects, with more or less the same users posting in both threads. Arguments are fiercely debated in both camps. Borland had their own vision. As a community, now that Delphi has changed ownership I believe we should try to be more consistent, more clear, and more articulate in what we expect from Embercadero in terms of Delphi. We can contribute to keeping Delphi alive and moving in the right direction. "Laurent Cocea" schrieb: > Sadly, it seems to me that there ...

How to use FormView 's edit, cancel, insert and delete without using a control (Ex: sqldatasource, objectdatasource, etc..)?
I'm using C#, I cannot find any examples how to use edit, cancel, update, delete feature of the formview without using controls like objectdataSource/sqldataSource? I have 4 buttons (EDIT, SAVE, CANCEL, Delete), not sure how trigger the edit temple, insert template, etc... I would perfer to do it it programmatically. I would be grateful for any help!    if oyu want to change the Current Displayed Tempalte for the FormView , you can call FormView.ChangeMode as  follows:   ' put the FormView in edit mode FormView1.ChangeMode(FormViewMode.Edit)...

Is there a textbox control that does NOT use the 'size=1, size4' etc. archaic form of html? But uses more modern css?
Hey folks.  After showing the site to a number of writers, they're very happy w/the features of DNN, but not at all w/the Text/HTML module, since obviously, how they're writing *looks* is sort of important to them, and the granularity of FTB, and the size=1, etc...is just not gonna do it.  I know there's a discussion *somewhere* on other editors, but when I do a search, I get like 20 pages of stuff to wade through, and after spending 30 minutes reading, I never see a mention of this feature, which is of critical importance to writers. Is there a TextBox that allows use o...

is it possible to use loginstatus control without using login control?
 Hi friendspls let me clear in this.is it possible to use loginstatus control without using login control?thanks in advance          Yes, if you write your own login control that plugs in using asp.net authentication via the provider model then the login status will still work fine.You can set up custom providers in web.config.  thanks to reply. can u give me a sample code?  Yeah for custom providers in web.config its pretty simple, but the rolling your own is a complex task. Do you already have a database or some reason for...

How to use Delphi control TButtonedEdit
Hello: I am trying for the first time to use a TButtonedEdit. I would like to have the Left or Right button enabled and visible, but for some strange reason I cannot make them be displayed. I've tried setting the LeftButton.Visible and RightButton.Visible to True both at design time and at run time. Why won't these buttons display themselves? Len Len wrote: > I am trying for the first time to use a TButtonedEdit. I would like > to have the Left or Right button enabled and visible, but for some > strange reason I cannot make them be displayed. I guess you did no...

How do YOU build your server controls? Using writer to output html or using controls?
What's the preferred way of overriding Render when building server controls?  Is it better to use the writer to output the html with RenderBeginTag and etc, or is it better to just create a table/panel control and add controls to it and render the table/panel control?For example, let say I want to create a server control to output the following in html<table>   <tr>      <td>         Welcome      </td>      <td&g...

Modifing javascript to use server controls instead of using html controls
Hi, I use a Javascript to create a textbox that converts English to Hindi text. I am using it in my aspx pages. I use another javascript to access the Text of this HTML textbox.  Everything is fine when I use Single TextBox on a page. But the complexities go out of my control when i need to use 5 such textboxes on the same aspx page. Moreover I encounter issues of ID of ASP.NET controls that get changed as there are ContentPlaceHolders, TabPanels etc. I don't know the javascript things so deeply that I can comprehend the code that generates the custom Textbox. Now I ne...

Which control to use
Basically I need to display 5 columns of data, and 10 rows at a time.  I would use a DataGrid for obvious reasons i.e. paging etc.  But I need to display in the each column, the date from a sql database, a checkbox, a picture (which is a location in a database, the actual file is stored in a file system), the users name in the fourth column and two buttons (approve, deny) in the last column.Right now I have all of this in a table control because I can customize each cell, but as I'm writing my own paging control, I'm realizing this is a big pain in the butt.  Any help would be...

Do you use the user controls etc or build your own?
I'm planning to develop a tool which will keep track off time spent on projects. Its going to need login and different roles depending on whether the user is a from our company or is a client. I'm just wondering, do people use the build in membership controls, or do they build their own?Alive with Technology Ltd membership API is verry good to construct ur security , but for cutom things its better you use it in code not builtin controlsA fine is a tax for doing wrong. A tax is a fine for doing well.__________________________________________________Please remember to click “Mark a...

Issue with getting values from child controls in a gridview, to use for the update using a SQLDataSource control
Hi all, I have a gridview bound with a SQLDataSource. I am using the Update feature of the SQLDataSource to update a SQL Server database with values entered into the gridview. However I am not getting it to work. I believe this is due to the controls that contain the user entries are not the gridview itself, but rather child controls within the gridview. I have been using the names of the actual controls but nothing happens. Upon submit, the screen returns blank, and the database is not updated. Here is some code:   <asp:GridView ID="GridEditSettlement" runat="server" AutoGenerate...

Web resources about - TSpinButton, TTimerSpeedButton etc for motion control - embarcadero.delphi.vcl.using

Resources last updated: 1/23/2016 7:30:46 PM