Viewer color
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Viewer color
Hi Taras,
That's a bit more complicated. Screen Script has the capability to change the Background bitmap. See how it is done in Screen.cpp function
int CScreen::DoMainDlg(CStringW s)
if condition
if (BGFile_loaded != BGFile)
I suppose you could also create a Main Dialog Screen Script line such as:
Main:CX:1258,CY:961,BackColor:C0C0C0,Caption:1,MaxBox:1,MinBox:1,ResizeFrame:0,Maximize:0,BackBitmap:Images\tileable-metal-textures-8.jpg
and pass it to that function.
HTH
That's a bit more complicated. Screen Script has the capability to change the Background bitmap. See how it is done in Screen.cpp function
int CScreen::DoMainDlg(CStringW s)
if condition
if (BGFile_loaded != BGFile)
I suppose you could also create a Main Dialog Screen Script line such as:
Main:CX:1258,CY:961,BackColor:C0C0C0,Caption:1,MaxBox:1,MinBox:1,ResizeFrame:0,Maximize:0,BackBitmap:Images\tileable-metal-textures-8.jpg
and pass it to that function.
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Viewer color
Did I understand you correctly ?
I include the contents of Screen
#include "Screen.h"
Then I try to change the image in the script.
void CKMotionCNCDlg::SetBigValueColor(CDisplay *Disp,int axis, bool KMotionPresent, bool DisplayedEnc)
{
if (m_Simulate)
Disp->SetTextColor(0xFFFFFF);
else if (KMotionPresent && (MainStatus.Enables & (1<<CS_axis[axis])) && CS_axis[axis] >= 0)
{
if (m_ShowMach)
Disp->SetTextColor(0x0080FF);
else
if (DisplayedEnc)
Disp->SetTextColor(0xFFC000);
else
Disp->SetTextColor(0x00FF00);
}
else
Disp->SetTextColor(0x00FFFF);
Screen.BitmapFile - how to point the way forward?
}
Regards,
Taras.
I include the contents of Screen
#include "Screen.h"
Then I try to change the image in the script.
void CKMotionCNCDlg::SetBigValueColor(CDisplay *Disp,int axis, bool KMotionPresent, bool DisplayedEnc)
{
if (m_Simulate)
Disp->SetTextColor(0xFFFFFF);
else if (KMotionPresent && (MainStatus.Enables & (1<<CS_axis[axis])) && CS_axis[axis] >= 0)
{
if (m_ShowMach)
Disp->SetTextColor(0x0080FF);
else
if (DisplayedEnc)
Disp->SetTextColor(0xFFC000);
else
Disp->SetTextColor(0x00FF00);
}
else
Disp->SetTextColor(0x00FFFF);
Screen.BitmapFile - how to point the way forward?
}
Regards,
Taras.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Viewer color
Basically yes. But Screen.h is already included. And SetBigValueColor is called for all 6 axes ten times per second. So you will want to decide what to do if various DROs are different colors. And only change the bitmap when something changes that should change the bitmap.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Viewer color
Thank you Tom!
I would like you to help me write the function call correctly.
How to upload a new image?
This expression will not be correct. - Screen.BackBitmap:Images\tileable - metal - textures - 8.jpg;
What should I write after Screen.BackBitmap ?
Regards,
Taras.
I would like you to help me write the function call correctly.
How to upload a new image?
This expression will not be correct. - Screen.BackBitmap:Images\tileable - metal - textures - 8.jpg;
What should I write after Screen.BackBitmap ?
Regards,
Taras.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Viewer color
Hi Taras,
You don't need to "upload" it. Just put it somewhere.How to upload a new image?
Screen. wouldn't be appropriate. The idea is to create a screen script string (wide string) that includes the file name of your bitmap. If placed in the KMotionCNC\res\images folder it can use a relative path. Note because a slash is the escape character to add special characters to put in an actual slash a double slash is used. Then pass it to that function. Something like:This expression will not be correct. - Screen.BackBitmap:Images\tileable - metal - textures - 8.jpg;
What should I write after Screen.BackBitmap ?
Code: Select all
CStringW ws = L"Main:CX:1258,CY:961,BackColor:C0C0C0,Caption:1,MaxBox:1,MinBox:1,ResizeFrame:0,Maximize:0,BackBitmap:res\\images\\MyBitmap.png";
Screen.DoMainDlg(ws);
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Viewer color
Hi Tom.
I'm from Ukraine.
I am very grateful to you.
I did it. The further the more I like to work with the program.
My goal is to make the program interface more attractive and efficient.
I make my machine control based on the EloPOS monoblock complete with Kflop.Monoblock touch and control menu in KMotionCNC is not convenient for touch input.That's why I'm distracting you for which I apologize.
I want to make KMotionCNC controls look like DATRON Dynamics.
The photo below shows a similar menu.
It will not be a one-on-one copy, but it will be similar.
If you do not mind, I will distract you about this?
Thank you Tom!
Regards,
Taras.
I'm from Ukraine.
I am very grateful to you.
I did it. The further the more I like to work with the program.
My goal is to make the program interface more attractive and efficient.
I make my machine control based on the EloPOS monoblock complete with Kflop.Monoblock touch and control menu in KMotionCNC is not convenient for touch input.That's why I'm distracting you for which I apologize.
I want to make KMotionCNC controls look like DATRON Dynamics.
The photo below shows a similar menu.
It will not be a one-on-one copy, but it will be similar.
If you do not mind, I will distract you about this?
Thank you Tom!
Regards,
Taras.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Viewer color
Hi Taras,
Feel free to ask specific questions. Especially if you are willing to make the source code public.
Stay safe
Feel free to ask specific questions. Especially if you are willing to make the source code public.
Stay safe
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Viewer color
Thank you Tom!
Of course the code will be available to everyone.
Regards,
Taras.
Of course the code will be available to everyone.
Regards,
Taras.
Re: Viewer color
Hi Tom.
Maybe I'll be gone for a while.
Now we are assembling the machine to order. And for one thing, I would like to assemble a stand for a monoblock and a remote control to make it more convenient to work.I have at the moment the only question. Why can't I rotate the view in the processing window?
My only question at the moment is how to rotate the view in GViewer ? Like in this video https://www.youtube.com/watch?v=VkBhYpyGpNU
I can move it but I can't rotate it.
Regards,
Taras.
Maybe I'll be gone for a while.
Now we are assembling the machine to order. And for one thing, I would like to assemble a stand for a monoblock and a remote control to make it more convenient to work.I have at the moment the only question. Why can't I rotate the view in the processing window?
My only question at the moment is how to rotate the view in GViewer ? Like in this video https://www.youtube.com/watch?v=VkBhYpyGpNU
I can move it but I can't rotate it.
Regards,
Taras.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Viewer color
Hi Taras,
I'm not sure I understand the question. Do you have a mouse? Hold both left and right mouse buttons down to rotate.
I'm not sure I understand the question. Do you have a mouse? Hold both left and right mouse buttons down to rotate.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.