fltk-rs / fl2rust

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

OflatBox should be OFlatBox #14

Closed 1sra3l closed 2 years ago

1sra3l commented 2 years ago

https://github.com/fltk-rs/fl2rust/blob/62e26384b84fb7a782fd4a30093cfb9c611bdec0/src/utils.rs#L51

Is this where the word is interpreted?

    let ret = match s.as_str() {
        "Vert fill" => "VerticalFill",
        "Horz fill" => "HorizontalFill",
        "Vert knob" => "VerticalNice",
        "Horz knob" => "HorizontalNice",
        // this would likely fix it
        "OflatBox" => "OFlatBox",
        _ => s.as_str(),
    };
MoAlyousef commented 2 years ago

It's interpreted here: https://github.com/fltk-rs/fl2rust/blob/62e26384b84fb7a782fd4a30093cfb9c611bdec0/src/gen.rs#L261

MoAlyousef commented 2 years ago

FLUID creates an OFLAT_BOX which now generates an OFlatBox.

1sra3l commented 2 years ago

@MoAlyousef one more issue here the "down_box"

                        "down_box" => {
                            if let Some(p) = props.get(i.wrapping_sub(1)) {
                                if p != "label" {
                                    let temp =
                                        utils::global_to_pascal(utils::unbracket(&props[i + 1]));
                                    let temp = match temp.as_str() {
                                        "OflatBox" => "OFlatBox",
                                        "OshadowBox" => "OShadowBox",
                                        "RflatBox" => "RFlatBox",
                                        "RshadowBox" => "RShadowBox",
                                        _ => temp.as_str(),
                                    };
                                    imp += &format!(
                                        "\t{}.set_down_frame(FrameType::{});\n",
                                        &elem.ident, temp,
                                    );
                                }
                            } else {
                                let temp = utils::global_to_pascal(utils::unbracket(&props[i + 1]));
                                let temp = match temp.as_str() {
                                    "OflatBox" => "OFlatBox",
                                    "OshadowBox" => "OShadowBox",
                                    "RflatBox" => "RFlatBox",
                                    "RshadowBox" => "RShadowBox",
                                    _ => temp.as_str(),
                                };
                                imp += &format!(
                                    "\t{}.set_down_frame(FrameType::{});\n",
                                    &elem.ident, temp,
                                );
                            }
                        }
MoAlyousef commented 2 years ago

Oops. I’ll add it when I get home.

MoAlyousef commented 2 years ago

This should be now fixed in 0.4.15 :)