Removed i32 and f32 variants of input and slider.

This commit is contained in:
Cameron Hart 2016-06-09 08:12:40 +10:00
parent ad943962e5
commit bbb46c7446
2 changed files with 5 additions and 11 deletions

View File

@ -241,7 +241,7 @@ fn show_test_window<'a>(ui: &Ui<'a>, state: &mut State, opened: &mut bool) {
ui.same_line(300.0); ui.same_line(300.0);
ui.checkbox(im_str!("no collapse"), &mut state.no_collapse); ui.checkbox(im_str!("no collapse"), &mut state.no_collapse);
ui.checkbox(im_str!("no menu"), &mut state.no_menu); ui.checkbox(im_str!("no menu"), &mut state.no_menu);
ui.slider_f32(im_str!("bg alpha"), &mut state.bg_alpha, 0.0, 1.0).build(); ui.slider_float(im_str!("bg alpha"), &mut state.bg_alpha, 0.0, 1.0).build();
ui.tree_node(im_str!("Style")).build(|| { ui.tree_node(im_str!("Style")).build(|| {
// TODO: Reimplement style editor // TODO: Reimplement style editor
@ -289,7 +289,7 @@ fn show_test_window<'a>(ui: &Ui<'a>, state: &mut State, opened: &mut bool) {
suitable for English and possibly other languages.")); suitable for English and possibly other languages."));
ui.spacing(); ui.spacing();
ui.slider_f32(im_str!("Wrap width"), &mut state.wrap_width, -20.0, 600.0) ui.slider_float(im_str!("Wrap width"), &mut state.wrap_width, -20.0, 600.0)
.display_format(im_str!("%.0f")) .display_format(im_str!("%.0f"))
.build(); .build();
@ -423,7 +423,7 @@ fn show_example_app_auto_resize<'a>(ui: &Ui<'a>, state: &mut AutoResizeState, op
ui.text(im_str!("Window will resize every-ui to the size of its content. ui.text(im_str!("Window will resize every-ui to the size of its content.
Note that you probably don't want to query the window size to Note that you probably don't want to query the window size to
output your content because that would create a feedback loop.")); output your content because that would create a feedback loop."));
ui.slider_i32(im_str!("Number of lines"), &mut state.lines, 1, 20).build(); ui.slider_int(im_str!("Number of lines"), &mut state.lines, 1, 20).build();
for i in 0 .. state.lines { for i in 0 .. state.lines {
ui.text(im_str!("{:2$}This is line {}", "", i, i as usize * 4)); ui.text(im_str!("{:2$}This is line {}", "", i, i as usize * 4));
} }

View File

@ -499,9 +499,6 @@ impl<'ui> Ui<'ui> {
pub fn input_text<'p>(&self, label: ImStr<'p>, buf: &'p mut str) -> InputText<'ui, 'p> { pub fn input_text<'p>(&self, label: ImStr<'p>, buf: &'p mut str) -> InputText<'ui, 'p> {
InputText::new(label, buf) InputText::new(label, buf)
} }
pub fn input_f32<'p>(&self, label: ImStr<'p>, value: &'p mut f32) -> InputFloat<'ui, 'p> {
InputFloat::new(label, value)
}
pub fn input_float<'p>(&self, label: ImStr<'p>, value: &'p mut f32) -> InputFloat<'ui, 'p> { pub fn input_float<'p>(&self, label: ImStr<'p>, value: &'p mut f32) -> InputFloat<'ui, 'p> {
InputFloat::new(label, value) InputFloat::new(label, value)
} }
@ -514,9 +511,6 @@ impl<'ui> Ui<'ui> {
pub fn input_float4<'p>(&self, label: ImStr<'p>, value: &'p mut [f32;4]) -> InputFloat4<'ui, 'p> { pub fn input_float4<'p>(&self, label: ImStr<'p>, value: &'p mut [f32;4]) -> InputFloat4<'ui, 'p> {
InputFloat4::new(label, value) InputFloat4::new(label, value)
} }
pub fn input_i32<'p>(&self, label: ImStr<'p>, value: &'p mut i32) -> InputInt<'ui, 'p> {
InputInt::new(label, value)
}
pub fn input_int<'p>(&self, label: ImStr<'p>, value: &'p mut i32) -> InputInt<'ui, 'p> { pub fn input_int<'p>(&self, label: ImStr<'p>, value: &'p mut i32) -> InputInt<'ui, 'p> {
InputInt::new(label, value) InputInt::new(label, value)
} }
@ -533,11 +527,11 @@ impl<'ui> Ui<'ui> {
// Widgets: Sliders // Widgets: Sliders
impl<'ui> Ui<'ui> { impl<'ui> Ui<'ui> {
pub fn slider_f32<'p>(&self, label: ImStr<'p>, pub fn slider_float<'p>(&self, label: ImStr<'p>,
value: &'p mut f32, min: f32, max: f32) -> SliderFloat<'ui, 'p> { value: &'p mut f32, min: f32, max: f32) -> SliderFloat<'ui, 'p> {
SliderFloat::new(label, value, min, max) SliderFloat::new(label, value, min, max)
} }
pub fn slider_i32<'p>(&self, label: ImStr<'p>, pub fn slider_int<'p>(&self, label: ImStr<'p>,
value: &'p mut i32, min: i32, max: i32) -> SliderInt<'ui, 'p> { value: &'p mut i32, min: i32, max: i32) -> SliderInt<'ui, 'p> {
SliderInt::new(label, value, min, max) SliderInt::new(label, value, min, max)
} }