mirror of
https://github.com/opentx/opentx.git
synced 2025-07-19 22:35:12 +03:00
Cosmetics
This commit is contained in:
parent
afa69cb0c5
commit
65860da986
1 changed files with 20 additions and 20 deletions
|
@ -78,10 +78,10 @@ FXDEFMAP(OpenTxSim) OpenTxSimMap[] = {
|
||||||
FXIMPLEMENT(OpenTxSim, FXMainWindow, OpenTxSimMap, ARRAYNUMBER(OpenTxSimMap))
|
FXIMPLEMENT(OpenTxSim, FXMainWindow, OpenTxSimMap, ARRAYNUMBER(OpenTxSimMap))
|
||||||
|
|
||||||
OpenTxSim::OpenTxSim(FXApp* a):
|
OpenTxSim::OpenTxSim(FXApp* a):
|
||||||
FXMainWindow(a, "OpenTX Simu", NULL, NULL, DECOR_ALL, 20, 90, 0, 0)
|
FXMainWindow(a, "OpenTX Simu", nullptr, nullptr, DECOR_ALL, 20, 90, 0, 0)
|
||||||
{
|
{
|
||||||
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE * sizeof(display_t));
|
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE * sizeof(display_t));
|
||||||
bmp = new FXPPMImage(getApp(),NULL,IMAGE_OWNED|IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP, W2, H2);
|
bmp = new FXPPMImage(getApp(), nullptr, IMAGE_OWNED|IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP, W2, H2);
|
||||||
|
|
||||||
#if defined(SIMU_AUDIO)
|
#if defined(SIMU_AUDIO)
|
||||||
SDL_Init(SDL_INIT_AUDIO);
|
SDL_Init(SDL_INIT_AUDIO);
|
||||||
|
@ -95,16 +95,16 @@ OpenTxSim::OpenTxSim(FXApp* a):
|
||||||
switch (i) {
|
switch (i) {
|
||||||
#define L LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT|LAYOUT_FIX_X|LAYOUT_FIX_Y
|
#define L LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT|LAYOUT_FIX_X|LAYOUT_FIX_Y
|
||||||
case 0:
|
case 0:
|
||||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_HORIZONTAL,10,110,100,20);
|
sliders[i]=new FXSlider(hf1, nullptr, 0, L|SLIDER_HORIZONTAL, 10, 110, 100, 20);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_VERTICAL,110,10,20,100);
|
sliders[i]=new FXSlider(hf1, nullptr, 0, L|SLIDER_VERTICAL, 110, 10, 20, 100);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_VERTICAL,130,10,20,100);
|
sliders[i]=new FXSlider(hf1, nullptr, 0, L|SLIDER_VERTICAL, 130, 10, 20, 100);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_HORIZONTAL,150,110,100,20);
|
sliders[i]=new FXSlider(hf1, nullptr, 0, L|SLIDER_HORIZONTAL, 150, 110, 100, 20);
|
||||||
break;
|
break;
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ OpenTxSim::OpenTxSim(FXApp* a):
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0; i<NUM_POTS+NUM_SLIDERS; i++){
|
for(int i=0; i<NUM_POTS+NUM_SLIDERS; i++){
|
||||||
knobs[i]= new FXKnob(hf11,NULL,0,KNOB_TICKS|LAYOUT_LEFT);
|
knobs[i]= new FXKnob(hf11, nullptr, 0, KNOB_TICKS|LAYOUT_LEFT);
|
||||||
knobs[i]->setValue(0);
|
knobs[i]->setValue(0);
|
||||||
|
|
||||||
#if defined(PCBHORUS)
|
#if defined(PCBHORUS)
|
||||||
|
@ -165,7 +165,7 @@ OpenTxSim::~OpenTxSim()
|
||||||
|
|
||||||
void OpenTxSim::createBitmap(int index, uint16_t *data, int x, int y, int w, int h)
|
void OpenTxSim::createBitmap(int index, uint16_t *data, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
FXPNGImage snapshot(getApp(), NULL, IMAGE_OWNED, w, h);
|
FXPNGImage snapshot(getApp(), nullptr, IMAGE_OWNED, w, h);
|
||||||
|
|
||||||
for (int i=0; i<w; i++) {
|
for (int i=0; i<w; i++) {
|
||||||
for (int j=0; j<h; j++) {
|
for (int j=0; j<h; j++) {
|
||||||
|
@ -191,7 +191,7 @@ void OpenTxSim::createBitmap(int index, uint16_t *data, int x, int y, int w, int
|
||||||
void OpenTxSim::makeSnapshot(const FXDrawable* drawable)
|
void OpenTxSim::makeSnapshot(const FXDrawable* drawable)
|
||||||
{
|
{
|
||||||
// Construct and create an FXImage object
|
// Construct and create an FXImage object
|
||||||
FXPNGImage snapshot(getApp(), NULL, 0, drawable->getWidth(), drawable->getHeight());
|
FXPNGImage snapshot(getApp(), nullptr, 0, drawable->getWidth(), drawable->getHeight());
|
||||||
snapshot.create();
|
snapshot.create();
|
||||||
|
|
||||||
// Create a window device context and lock it onto the image
|
// Create a window device context and lock it onto the image
|
||||||
|
@ -541,7 +541,7 @@ int main(int argc, char ** argv)
|
||||||
// The decorations determine stuff like the borders, close buttons,
|
// The decorations determine stuff like the borders, close buttons,
|
||||||
// drag handles, and so on the Window Manager is supposed to give this
|
// drag handles, and so on the Window Manager is supposed to give this
|
||||||
// window.
|
// window.
|
||||||
//FXMainWindow *main=new FXMainWindow(&application,"Hello",NULL,NULL,DECOR_ALL);
|
//FXMainWindow *main=new FXMainWindow(&application, "Hello", nullptr, nullptr, DECOR_ALL);
|
||||||
opentxSim = new OpenTxSim(&application);
|
opentxSim = new OpenTxSim(&application);
|
||||||
application.create();
|
application.create();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue