rebased and waiting for green

This commit is contained in:
Jack Mac 2021-09-14 11:14:09 -04:00
parent be9fd26595
commit 6e1f359d08
2 changed files with 26 additions and 3 deletions

View File

@ -294,15 +294,15 @@ impl<'a> Id<'a> {
fn as_imgui_id(&self) -> sys::ImGuiID {
unsafe {
match self {
Id::Ptr(p) => sys::igGetIDPtr(*p),
Id::Ptr(p) => sys::igGetID_Ptr(*p),
Id::Str(s) => {
let s1 = s.as_ptr() as *const std::os::raw::c_char;
let s2 = s1.add(s.len());
sys::igGetIDStrStr(s1, s2)
sys::igGetID_StrStr(s1, s2)
}
Id::Int(i) => {
let p = *i as *const std::os::raw::c_void;
sys::igGetIDPtr(p)
sys::igGetID_Ptr(p)
} // Id::ImGuiID(n) => *n,
}
}

View File

@ -684,7 +684,30 @@ impl<'ui> Ui<'ui> {
}
}
/// Change user accessible enabled/disabled state of the current column.
///
/// Set to false to hide the column. Users can use the context menu to change
/// this themselves by right-clicking in headers, or right-clicking in columns body
/// if [TableFlags::CONTEXT_MENU_IN_BODY].
///
/// Use [table_set_enabled_with_column](Self::table_set_enabled_with_column) to set
/// for arbitrary indices.
pub fn table_set_enabled(&self, enabled: bool) {
unsafe { sys::igTableSetColumnEnabled(-1, enabled) }
}
/// Change user accessible enabled/disabled state of the current column.
///
/// Set to false to hide the column. Users can use the context menu to change
/// this themselves by right-clicking in headers, or right-clicking in columns body
/// if [TableFlags::CONTEXT_MENU_IN_BODY].
pub fn table_set_enabled_with_column(&self, enabled: bool, column_idx: usize) {
unsafe { sys::igTableSetColumnEnabled(column_idx as i32, enabled) }
}
/// Gets the sorting data for a table. This will be `None` when not sorting.
///
/// See the examples folder for how to use the sorting API.
pub fn table_sort_specs_mut(&self) -> Option<TableSortSpecsMut<'_>> {
unsafe {
let value = sys::igTableGetSortSpecs();