You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: wgt_encoder.rs
    path of file: ./repos/CaptfEncoder/CaptfEncoder-V3/main/src/apps/widgets
    
    the code of the file until where you have to start completion: use std::cell::RefCell;
use std::collections::HashMap;

use std::rc::Rc;

use fltk::{
    
    button::*,
    enums::{Align, CallbackTrigger, Color, FrameType},
    frame::*,
    group::*,
    menu::*,
    prelude::*,
    text::*,
};

use crate::apps::extensions::{ExtensionOption, IEncoderHandler};

use super::wgt_editor_dnd;
use super::wgt_encoder_handle;
use super::wgt_encoder_menu;
use super::wgt_option;
use super::WgtOptionComp;

#[derive(Clone)]
pub struct WgtEncoder {
    toggle: ToggleButton,
    input_text: TextEditor,
    output_text: TextDisplay,
    input_button: MenuButton,
    output_button: MenuButton,
    message_frame: Frame,
    option_data: Rc<RefCell<wgt_option::OptionData>>,
    option_comps: Vec<Box<dyn WgtOptionComp>>,
}

impl WgtEncoder {
    pub fn new(grp: &Group, options: &Vec<ExtensionOption>) -> Self {
        let option_data: Rc<RefCell<wgt_option::OptionData>> =
            Rc::from(RefCell::from(wgt_option::OptionData {
                options: options.clone(),
                values: HashMap::new(),
            }));

        let mut flex = Flex::default_fill().column();
        flex.set_margin(15);

        let mut row = Flex::default_fill().row();
        let _frame = Frame::default();
        let mut toggle = ToggleButton::default();
        toggle.set_align(Align::Left | Align::Inside);
        toggle.set_frame(FrameType::RFlatBox);
        toggle.set_label("Encode");
        toggle.clear_visible_focus();
        
    
    pub fn new(grp: &Group, options: &Vec<ExtensionOption>) -> Self {
        let option_data: Rc<RefCell<wgt_option::OptionData>> =
            Rc::from(RefCell::from(wgt_option::OptionData {
                options: options.clone(),
                values: HashMap::new(),
            }));

        let mut flex = Flex::default_fill().column();
        flex.set_margin(15);

        let mut row = Flex::default_fill().row();
        let _frame = Frame::default();
        let mut toggle = ToggleButton::default();
        toggle.set_align(Align::Left | Align::Inside);
        toggle.set_frame(FrameType::RFlatBox);
        toggle.set_label("Encode");
        toggle.clear_visible_focus();
        toggle.set_tooltip("Switching encoding and decoding");
        toggle.set_trigger(CallbackTrigger::Changed);
        row.set_size(&toggle, 100);
        row.end();
        flex.set_size(&row, 30);

        let option_comps = wgt_option::generate_options(&option_data, &mut flex);

        let mut row = Flex::default_fill().row();
        let mut input_button = MenuButton::default();
        input_button.set_label("Input");
        row.set_size(&input_button, 100);
        row.end();
        flex.set_size(&row, 30);

        let mut input_text = TextEditor::default();
        input_text.wrap_mode(WrapMode::AtBounds, 0);

        let mut message_frame = Frame::default().with_align(Align::Center | Align::Wrap);
        message_frame.set_label_color(Color::DarkRed);
        message_frame.set_label("");
        flex.set_size(&message_frame, 30);

        let mut row = Flex::default_fill().row();
        let mut output_button = MenuButton::default();
        output_button.set_label("Output");
        row.set_size(&output_button, 100);
        row.end();
        flex.set_size(&row, 30);

        let mut output_text = TextDisplay::default();
        output_text.wrap_mode(WrapMode::AtBounds, 0);

        flex.end();

        grp.end();

        Self {
            toggle: toggle,
            input_text: input_text,
            output_text: output_text,
            input_button: input_button,
            output_button: output_button,
            message_frame: message_frame,
            option_data: option_data,
            option_comps: option_comps,
        }
    }