Hi,
I try to figure how to change a value of a edit box in the screeneditor with a c program.
Change value of a edit box in the screeneditor with a c program
Moderators: TomKerekes, dynomotion
-
- Posts: 47
- Joined: Fri Nov 01, 2019 7:18 pm
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Change value of a edit box in the screeneditor with a c program
Hi,
An Edit Control is normally used for Operator Input. There is only a method of reading the Control not writing. Why do you need to change the value from a C Program?
An Edit Control is normally used for Operator Input. There is only a method of reading the Control not writing. Why do you need to change the value from a C Program?
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 47
- Joined: Fri Nov 01, 2019 7:18 pm
Re: Change value of a edit box in the screeneditor with a c program
Hi Tom,
I have a value that I need in two different screen. This value is calculated, but the user can mdoify them.
I have a value that I need in two different screen. This value is calculated, but the user can mdoify them.
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Change value of a edit box in the screeneditor with a c program
Hi 4minnovations,
Here is a patch for V4.35b that should allow setting Text in an Edit Control. It also includes some other patches (More unicode support for controls, combo box controls, and the Set DRO to half option).
New KMotionCNC.exe copy to \KMotion435b\KMotion\Release
New KflopToKMotionCNCFunctions.c which includes new SetEditControl function copy to \KMotion435b\C Programs
Example C Program to set an Edit Control Text
Sources if needed.
Here is a patch for V4.35b that should allow setting Text in an Edit Control. It also includes some other patches (More unicode support for controls, combo box controls, and the Set DRO to half option).
New KMotionCNC.exe copy to \KMotion435b\KMotion\Release
New KflopToKMotionCNCFunctions.c which includes new SetEditControl function copy to \KMotion435b\C Programs
Example C Program to set an Edit Control Text
Code: Select all
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
void main()
{
char s[80];
// Convert number to string
sprintf(s,"%g",123.4);
// Put it onto the Screen
SetEditControl(1000, 160, s);
}
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 47
- Joined: Fri Nov 01, 2019 7:18 pm
Re: Change value of a edit box in the screeneditor with a c program
Thanks Tom,
it's work perfectly.
it's work perfectly.