Skip to content

Commit

Permalink
Merge pull request #1 from inkyblackness/main
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
JetSetIlly authored Mar 17, 2021
2 parents 8ea0023 + ebf5e2d commit f3b0702
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Popup.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const (

// BeginPopupV returns true if the popup is open, and you can start outputting to it.
// Only call EndPopup() if BeginPopup() returns true.
func BeginPopupV(name string, flags PopupFlags) bool {
// WindowFlags are forwarded to the window.
func BeginPopupV(name string, flags WindowFlags) bool {
nameArg, nameFin := wrapString(name)
defer nameFin()
return C.iggBeginPopup(nameArg, C.int(flags)) != 0
Expand All @@ -49,7 +50,8 @@ func BeginPopup(name string) bool {

// BeginPopupModalV creates modal dialog (regular window with title bar, block interactions behind the modal window,
// can't close the modal window by clicking outside).
func BeginPopupModalV(name string, open *bool, flags PopupFlags) bool {
// WindowFlags are forwarded to the window.
func BeginPopupModalV(name string, open *bool, flags WindowFlags) bool {
nameArg, nameFin := wrapString(name)
defer nameFin()
openArg, openFin := wrapBool(open)
Expand Down
4 changes: 2 additions & 2 deletions State.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ const (

// MouseCursor returns desired cursor type, reset in imgui.NewFrame(), this is updated during the frame.
// Valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you.
func MouseCursor() int {
return int(C.iggGetMouseCursor())
func MouseCursor() MouseCursorID {
return MouseCursorID(C.iggGetMouseCursor())
}

// SetMouseCursor sets desired cursor type.
Expand Down
6 changes: 3 additions & 3 deletions Tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ func TableGetColumnName() string {
}

// TableGetColumnFlagsV return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
func TableGetColumnFlagsV(columnN int) int {
return int(C.iggTableGetColumnFlags(C.int(columnN)))
func TableGetColumnFlagsV(columnN int) TableColumnFlags {
return TableColumnFlags(C.iggTableGetColumnFlags(C.int(columnN)))
}

// TableGetColumnFlags calls TableGetColumnFlagsV(-1).
func TableGetColumnFlags() int {
func TableGetColumnFlags() TableColumnFlags {
return TableGetColumnFlagsV(-1)
}

Expand Down
22 changes: 21 additions & 1 deletion Widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,26 @@ func RadioButton(id string, active bool) bool {
return C.iggRadioButton(idArg, castBool(active)) != 0
}

// RadioButtonInt modifies integer v. Returns true if it is selected.
//
// The radio button will be set if v == button. Useful for groups of radio
// buttons. In the example below, "radio b" will be selected.
//
// v := 1
// imgui.RadioButtonInt("radio a", &v, 0)
// imgui.RadioButtonInt("radio b", &v, 1)
// imgui.RadioButtonInt("radio c", &v, 2)
//
func RadioButtonInt(id string, v *int, button int) bool {
idArg, idFin := wrapString(id)
defer idFin()
ok := C.iggRadioButton(idArg, castBool(button == *v)) != 0
if ok {
*v = button
}
return ok
}

// Bullet draws a small circle and keeps the cursor on the same line.
// Advance cursor x position by TreeNodeToLabelSpacing(), same distance that TreeNode() uses.
func Bullet() {
Expand All @@ -128,7 +148,7 @@ func ProgressBarV(fraction float32, size Vec2, overlay string) {
C.iggProgressBar(C.float(fraction), sizeArg, overlayArg)
}

// ProgressBar calls ProgressBarV(fraction, Vec2{X: -1, Y: 0}, "").
// ProgressBar calls ProgressBarV(fraction, Vec2{X: -math.SmallestNonzeroFloat32, Y: 0}, "").
func ProgressBar(fraction float32) {
ProgressBarV(fraction, Vec2{X: -math.SmallestNonzeroFloat32, Y: 0}, "")
}
Expand Down

0 comments on commit f3b0702

Please sign in to comment.