1use crate::sys;
2use crate::Ui;
34/// # Columns
5impl<'ui> Ui<'ui> {
6#[doc(alias = "Columns")]
7pub fn columns(&self, count: i32, id: impl AsRef<str>, border: bool) {
8unsafe { sys::igColumns(count, self.scratch_txt(id), border) }
9 }
10/// Switches to the next column.
11 ///
12 /// If the current row is finished, switches to first column of the next row
13#[doc(alias = "NextColumn")]
14pub fn next_column(&self) {
15unsafe { sys::igNextColumn() }
16 }
17/// Returns the index of the current column
18#[doc(alias = "GetColumnIndex")]
19pub fn current_column_index(&self) -> i32 {
20unsafe { sys::igGetColumnIndex() }
21 }
22/// Returns the width of the current column (in pixels)
23#[doc(alias = "GetColumnWidth")]
24pub fn current_column_width(&self) -> f32 {
25unsafe { sys::igGetColumnWidth(-1) }
26 }
27#[doc(alias = "GetColumnWidth")]
28/// Returns the width of the given column (in pixels)
29pub fn column_width(&self, column_index: i32) -> f32 {
30unsafe { sys::igGetColumnWidth(column_index) }
31 }
32#[doc(alias = "SetColumnWidth")]
33/// Sets the width of the current column (in pixels)
34pub fn set_current_column_width(&self, width: f32) {
35unsafe { sys::igSetColumnWidth(-1, width) };
36 }
37#[doc(alias = "SetColumnWidth")]
38/// Sets the width of the given column (in pixels)
39pub fn set_column_width(&self, column_index: i32, width: f32) {
40unsafe { sys::igSetColumnWidth(column_index, width) };
41 }
42/// Returns the offset of the current column (in pixels from the left side of the content
43 /// region)
44#[doc(alias = "GetColumnOffset")]
45pub fn current_column_offset(&self) -> f32 {
46unsafe { sys::igGetColumnOffset(-1) }
47 }
48/// Returns the offset of the given column (in pixels from the left side of the content region)
49#[doc(alias = "GetColumnOffset")]
50pub fn column_offset(&self, column_index: i32) -> f32 {
51unsafe { sys::igGetColumnOffset(column_index) }
52 }
53/// Sets the offset of the current column (in pixels from the left side of the content region)
54#[doc(alias = "SetColumnOffset")]
55pub fn set_current_column_offset(&self, offset_x: f32) {
56unsafe { sys::igSetColumnOffset(-1, offset_x) };
57 }
58/// Sets the offset of the given column (in pixels from the left side of the content region)
59#[doc(alias = "SetColumnOffset")]
60pub fn set_column_offset(&self, column_index: i32, offset_x: f32) {
61unsafe { sys::igSetColumnOffset(column_index, offset_x) };
62 }
63/// Returns the current amount of columns
64#[doc(alias = "GetColumnCount")]
65pub fn column_count(&self) -> i32 {
66unsafe { sys::igGetColumnsCount() }
67 }
68}