fn open_selection(&mut self, ctx: &mut Context, p: Point) {
        // upper left point of our ComboBox selector
        let combo_box_position = ctx.widget().clone::<Point>("position");
        let combo_box_bounds = ctx.widget().clone::<Rectangle>("bounds");
        let combo_box_global_bounds = Rectangle::new(combo_box_position, combo_box_bounds.size());

        let popup_placement: Placement = ctx.widget().clone("placement");
        let popup_offset: f64 = ctx.widget().clone("offset");

        // open the popup if `mouse down` point is inside of the ComboBox bounds.
        if combo_box_global_bounds.contains(p) {
            ctx.widget().set("selected", true);
            ctx.widget()
                .get_mut::<Selector>("selector")
                .push_state("selected");
            ctx.get_widget(self.popup)
                .set("visibility", Visibility::Visible);
            ctx.get_widget(self.popup).update(true);
            //ctx.get_widget(self.popup).set("offset", offset);
            Popup::placement_set(&mut ctx.get_widget(self.popup), popup_placement);
            Popup::offset_set(&mut ctx.get_widget(self.popup), popup_offset);
            ctx.widget().update(true);
        }
    }
// opens a popup item box.
opens a popup item box.
opens a popup item box .
fn open_selection(&mut self, ctx: &mut Context, p: Point) {
        // upper left point of our ComboBox selector
        let combo_box_position = ctx.widget().clone::<Point>("position");
        let combo_box_bounds = ctx.widget().clone::<Rectangle>("bounds");
        let combo_box_global_bounds = Rectangle::new(combo_box_position, combo_box_bounds.size());
        let popup_placement: Placement = ctx.widget().clone("placement");
        let popup_offset: f64 = ctx.widget().clone("offset");
        // open the popup if `mouse down` point is inside of the ComboBox bounds.
        if combo_box_global_bounds.contains(p) {
            ctx.widget().set("selected", true);
            ctx.widget()
                .get_mut::<Selector>("selector")
                .push_state("selected");
            ctx.get_widget(self.popup)
                .set("visibility", Visibility::Visible);
            ctx.get_widget(self.popup).update(true);
            //ctx.get_widget(self.popup).set("offset", offset);
            Popup::placement_set(&mut ctx.get_widget(self.popup), popup_placement);
            Popup::offset_set(&mut ctx.get_widget(self.popup), popup_offset);
            ctx.widget().update(true);
        }
    }
fn open_selection ( & mut self , ctx : & mut Context , p : Point ) { // upper left point of our ComboBox selector let combo_box_position = ctx . widget ( ) . clone :: < Point > ( " " ) ; let combo_box_bounds = ctx . widget ( ) . clone :: < Rectangle > ( " " ) ; let combo_box_global_bounds = Rectangle :: new ( combo_box_position , combo_box_bounds . size ( ) ) ; let popup_placement : Placement = ctx . widget ( ) . clone ( " " ) ; let popup_offset : f64 = ctx . widget ( ) . clone ( " " ) ; // open the popup if `mouse down` point is inside of the ComboBox bounds. if combo_box_global_bounds . contains ( p ) { ctx . widget ( ) . set ( " " , true ) ; ctx . widget ( ) . get_mut :: < Selector > ( " " ) . push_state ( " " ) ; ctx . get_widget ( self . popup ) . set ( " " , Visibility :: Visible ) ; ctx . get_widget ( self . popup ) . update ( true ) ; //ctx.get_widget(self.popup).set("offset", offset); Popup :: placement_set ( & mut ctx . get_widget ( self . popup ) , popup_placement ) ; Popup :: offset_set ( & mut ctx . get_widget ( self . popup ) , popup_offset ) ; ctx . widget ( ) . update ( true ) ; } }
opens a popup item box.
opens a popup item box .
&mut self
ctx
&mut Context
p
Point