arcdps_imgui/
columns.rs

1use crate::sys;
2use crate::Ui;
3
4/// # Columns
5impl<'ui> Ui<'ui> {
6    #[doc(alias = "Columns")]
7    pub fn columns(&self, count: i32, id: impl AsRef<str>, border: bool) {
8        unsafe { 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")]
14    pub fn next_column(&self) {
15        unsafe { sys::igNextColumn() }
16    }
17    /// Returns the index of the current column
18    #[doc(alias = "GetColumnIndex")]
19    pub fn current_column_index(&self) -> i32 {
20        unsafe { sys::igGetColumnIndex() }
21    }
22    /// Returns the width of the current column (in pixels)
23    #[doc(alias = "GetColumnWidth")]
24    pub fn current_column_width(&self) -> f32 {
25        unsafe { sys::igGetColumnWidth(-1) }
26    }
27    #[doc(alias = "GetColumnWidth")]
28    /// Returns the width of the given column (in pixels)
29    pub fn column_width(&self, column_index: i32) -> f32 {
30        unsafe { sys::igGetColumnWidth(column_index) }
31    }
32    #[doc(alias = "SetColumnWidth")]
33    /// Sets the width of the current column (in pixels)
34    pub fn set_current_column_width(&self, width: f32) {
35        unsafe { sys::igSetColumnWidth(-1, width) };
36    }
37    #[doc(alias = "SetColumnWidth")]
38    /// Sets the width of the given column (in pixels)
39    pub fn set_column_width(&self, column_index: i32, width: f32) {
40        unsafe { 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")]
45    pub fn current_column_offset(&self) -> f32 {
46        unsafe { 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")]
50    pub fn column_offset(&self, column_index: i32) -> f32 {
51        unsafe { 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")]
55    pub fn set_current_column_offset(&self, offset_x: f32) {
56        unsafe { 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")]
60    pub fn set_column_offset(&self, column_index: i32, offset_x: f32) {
61        unsafe { sys::igSetColumnOffset(column_index, offset_x) };
62    }
63    /// Returns the current amount of columns
64    #[doc(alias = "GetColumnCount")]
65    pub fn column_count(&self) -> i32 {
66        unsafe { sys::igGetColumnsCount() }
67    }
68}