1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use super::super::super::EnumTrait;
use std::str::FromStr;
#[derive(Clone, Debug)]
pub enum ObjectValues {
    AuditingLine,
    AuditingRectangle,
    Button,
    Checkbox,
    Dialog,
    Drop,
    Edit,
    Group,
    GroupBox,
    Label,
    List,
    Movie,
    Note,
    Picture,
    Radio,
    Rectangle,
    Scroll,
    Shape,
    Spin,
}
impl Default for ObjectValues {
    fn default() -> Self {
        Self::Button
    }
}
impl EnumTrait for ObjectValues {
    fn get_value_string(&self) -> &str {
        match &self {
            Self::AuditingLine => "LineA",
            Self::AuditingRectangle => "RectA",
            Self::Button => "Button",
            Self::Checkbox => "Checkbox",
            Self::Dialog => "Dialog",
            Self::Drop => "Drop",
            Self::Edit => "Edit",
            Self::Group => "Group",
            Self::GroupBox => "GBox",
            Self::Label => "Label",
            Self::List => "List",
            Self::Movie => "Movie",
            Self::Note => "Note",
            Self::Picture => "Pict",
            Self::Radio => "Radio",
            Self::Rectangle => "Rect",
            Self::Scroll => "Scroll",
            Self::Shape => "Shape",
            Self::Spin => "Spin",
        }
    }
}
impl FromStr for ObjectValues {
    type Err = ();
    fn from_str(input: &str) -> Result<Self, Self::Err> {
        match input {
            "LineA" => Ok(Self::AuditingLine),
            "RectA" => Ok(Self::AuditingRectangle),
            "Button" => Ok(Self::Button),
            "Checkbox" => Ok(Self::Checkbox),
            "Dialog" => Ok(Self::Dialog),
            "Drop" => Ok(Self::Drop),
            "Edit" => Ok(Self::Edit),
            "Group" => Ok(Self::Group),
            "GBox" => Ok(Self::GroupBox),
            "Label" => Ok(Self::Label),
            "List" => Ok(Self::List),
            "Movie" => Ok(Self::Movie),
            "Note" => Ok(Self::Note),
            "Pict" => Ok(Self::Picture),
            "Radio" => Ok(Self::Radio),
            "Rect" => Ok(Self::Rectangle),
            "Scroll" => Ok(Self::Scroll),
            "Shape" => Ok(Self::Shape),
            "Spin" => Ok(Self::Spin),
            _ => Err(()),
        }
    }
}