Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Add CollapsingHeaderV with flags parameter #133

Merged
merged 3 commits into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -816,11 +816,16 @@ func ColorPicker4V(label string, col *[4]float32, flags int) bool {
return C.iggColorPicker4(labelArg, ccol, C.int(flags)) != 0
}

// CollapsingHeader adds a collapsing header.
// CollapsingHeader calls CollapsingHeaderV(label, 0).
func CollapsingHeader(label string) bool {
return CollapsingHeaderV(label, 0)
}

// CollapsingHeaderV adds a collapsing header with TreeNode flags.
func CollapsingHeaderV(label string, flags int) bool {
labelArg, labelFin := wrapString(label)
defer labelFin()
return C.iggCollapsingHeader(labelArg) != 0
return C.iggCollapsingHeader(labelArg, C.int(flags)) != 0
}

const (
Expand Down
4 changes: 2 additions & 2 deletions wrapper/Widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ IggBool iggColorPicker4(char const *label, float *col, int flags)
return ImGui::ColorPicker4(label, col, flags) ? 1 : 0;
}

IggBool iggCollapsingHeader(const char *label)
IggBool iggCollapsingHeader(const char *label, int flags)
{
return ImGui::CollapsingHeader(label) ? 1 : 0;
return ImGui::CollapsingHeader(label, flags) ? 1 : 0;
}

IggBool iggTreeNode(char const *label, int flags)
Expand Down
2 changes: 1 addition & 1 deletion wrapper/Widgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern void iggTreePop(void);
extern void iggSetNextItemOpen(IggBool open, int cond);
extern float iggGetTreeNodeToLabelSpacing(void);

extern IggBool iggCollapsingHeader(const char *label);
extern IggBool iggCollapsingHeader(const char *label, int flags);

extern IggBool iggSelectable(char const *label, IggBool selected, int flags, IggVec2 const *size);
extern IggBool iggListBoxV(char const *label, int *currentItem, char const *const items[], int itemCount, int heightItems);
Expand Down