fltk-rs / fl2rust

A fluid (fltk ui designer) file to Rust transpiler
MIT License
52 stars 3 forks source link

some conversion errors #1

Closed kogo59 closed 3 years ago

kogo59 commented 3 years ago
   Fl_Group OK_Cancel {open
      xywh {300 755 300 50} labeltype NO_LABEL
    } {...

results in

          OK_Cancel.set_label_type(LabelType::No);

should be

          OK_Cancel.set_label_type(LabelType::None);

   Fl_Value_Input LongitudeDec {
          label {Longitude:             }
          xywh {140 120 150 25} maximum 360
        }

results in

          LongitudeDec.set_maximum(360);

should be

          LongitudeDec.set_maximum(360 as f64);

    Fl_Value_Input_Altitude {
          label {Altitude [m]: }
          xywh {105 180 70 25} maximum 9000 step 0.1
        }

results in

          Altitude.set_step(0.1);

should be

          Altitude.set_step(0.1,1);

flrust 1.0.18 has only

    fn set_step(&mut self, a: f64, b: i32)

Using fl2rust 0.4.1 and rustc 1.52.1

MoAlyousef commented 3 years ago

Thanks for reporting. I’ll look into it.

MoAlyousef commented 3 years ago

I've pushed some fixes in version 0.4.2. Can you try it out?

kogo59 commented 3 years ago

It works.

MoAlyousef commented 3 years ago

Great 👍