Package org.lwjgl.util.tinyfd
Class TinyFileDialogs
- java.lang.Object
-
- org.lwjgl.util.tinyfd.TinyFileDialogs
-
public class TinyFileDialogs extends java.lang.ObjectBindings to tiny file dialogs, a native dialog library with support for:- message / question
- input / password
- save file
- open file & multiple files
- select folder
- color picker
The dialogs can be forced into console mode.
-
-
Field Summary
Fields Modifier and Type Field Description static java.nio.IntBuffertinyfd_forceConsoleCan be modified at run time.static java.lang.Stringtinyfd_needsContains info about requirements.static java.nio.IntBuffertinyfd_silent1 (default) or 0 : on unix, hide errors and warnings from called dialog.static java.nio.IntBuffertinyfd_verbose0 (default) or 1 : on unix, prints the command line calls.static java.lang.Stringtinyfd_versionContains tinyfd current version number.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longntinyfd_colorChooser(long aTitle, long aDefaultHexRGB, long aDefaultRGB, long aoResultRGB)Unsafe version of:colorChooserstatic longntinyfd_inputBox(long aTitle, long aMessage, long aDefaultInput)Unsafe version of:inputBoxstatic intntinyfd_messageBox(long aTitle, long aMessage, long aDialogType, long aIconType, int aDefaultButton)Unsafe version of:messageBoxstatic intntinyfd_notifyPopup(long aTitle, long aMessage, long aIconType)Unsafe version of:notifyPopupstatic longntinyfd_openFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription, int aAllowMultipleSelects)Unsafe version of:openFileDialogstatic longntinyfd_response()Unsafe version of:responsestatic longntinyfd_saveFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription)Unsafe version of:saveFileDialogstatic longntinyfd_selectFolderDialog(long aTitle, long aDefaultPath)Unsafe version of:selectFolderDialogstatic voidtinyfd_beep()static java.lang.Stringtinyfd_colorChooser(java.lang.CharSequence aTitle, java.lang.CharSequence aDefaultHexRGB, java.nio.ByteBuffer aDefaultRGB, java.nio.ByteBuffer aoResultRGB)Displays a color chooser dialog.static java.lang.Stringtinyfd_colorChooser(java.nio.ByteBuffer aTitle, java.nio.ByteBuffer aDefaultHexRGB, java.nio.ByteBuffer aDefaultRGB, java.nio.ByteBuffer aoResultRGB)Displays a color chooser dialog.static java.lang.Stringtinyfd_inputBox(java.lang.CharSequence aTitle, java.lang.CharSequence aMessage, java.lang.CharSequence aDefaultInput)Displays an input dialog.static java.lang.Stringtinyfd_inputBox(java.nio.ByteBuffer aTitle, java.nio.ByteBuffer aMessage, java.nio.ByteBuffer aDefaultInput)Displays an input dialog.static booleantinyfd_messageBox(java.lang.CharSequence aTitle, java.lang.CharSequence aMessage, java.lang.CharSequence aDialogType, java.lang.CharSequence aIconType, boolean aDefaultButton)Displays a message dialog.static booleantinyfd_messageBox(java.nio.ByteBuffer aTitle, java.nio.ByteBuffer aMessage, java.nio.ByteBuffer aDialogType, java.nio.ByteBuffer aIconType, boolean aDefaultButton)Displays a message dialog.static inttinyfd_notifyPopup(java.lang.CharSequence aTitle, java.lang.CharSequence aMessage, java.lang.CharSequence aIconType)Displays a notification popup.static inttinyfd_notifyPopup(java.nio.ByteBuffer aTitle, java.nio.ByteBuffer aMessage, java.nio.ByteBuffer aIconType)Displays a notification popup.static java.lang.Stringtinyfd_openFileDialog(java.lang.CharSequence aTitle, java.lang.CharSequence aDefaultPathAndFile, org.lwjgl.PointerBuffer aFilterPatterns, java.lang.CharSequence aSingleFilterDescription, boolean aAllowMultipleSelects)Displays a file open dialog.static java.lang.Stringtinyfd_openFileDialog(java.nio.ByteBuffer aTitle, java.nio.ByteBuffer aDefaultPathAndFile, org.lwjgl.PointerBuffer aFilterPatterns, java.nio.ByteBuffer aSingleFilterDescription, boolean aAllowMultipleSelects)Displays a file open dialog.static java.lang.Stringtinyfd_response()If you pass "tinyfd_query" asaTitle, the functions will not display the dialogs but will filltinyfd_responsewith the retain solution and return:static java.lang.Stringtinyfd_saveFileDialog(java.lang.CharSequence aTitle, java.lang.CharSequence aDefaultPathAndFile, org.lwjgl.PointerBuffer aFilterPatterns, java.lang.CharSequence aSingleFilterDescription)Displays a file save dialog.static java.lang.Stringtinyfd_saveFileDialog(java.nio.ByteBuffer aTitle, java.nio.ByteBuffer aDefaultPathAndFile, org.lwjgl.PointerBuffer aFilterPatterns, java.nio.ByteBuffer aSingleFilterDescription)Displays a file save dialog.static java.lang.Stringtinyfd_selectFolderDialog(java.lang.CharSequence aTitle, java.lang.CharSequence aDefaultPath)Displays a folder selection dialog.static java.lang.Stringtinyfd_selectFolderDialog(java.nio.ByteBuffer aTitle, java.nio.ByteBuffer aDefaultPath)Displays a folder selection dialog.
-
-
-
Field Detail
-
tinyfd_version
Contains tinyfd current version number.
-
tinyfd_needs
Contains info about requirements.
-
tinyfd_verbose
0 (default) or 1 : on unix, prints the command line calls.
-
tinyfd_silent
1 (default) or 0 : on unix, hide errors and warnings from called dialog.
-
tinyfd_forceConsole
Can be modified at run time.For unix & windows: 0 (graphic mode) or 1 (console mode).
0: try to use a graphic solution, if it fails then it uses console mode. 1: forces all dialogs into console mode even when the X server is present. It will use the package dialog or dialog.exe if installed. On windows it only makes sense for console applications.
-
-
Method Detail
-
ntinyfd_response
public static long ntinyfd_response()
Unsafe version of:response
-
tinyfd_response
public static java.lang.String tinyfd_response()
If you pass "tinyfd_query" asaTitle, the functions will not display the dialogs but will filltinyfd_responsewith the retain solution and return:Possible values for
tinyfd_responseare (all lowercase) for the graphic mode: windows applescript zenity zenity3 matedialog kdialog xdialog tkinter gdialog gxmessage xmessageFor the console mode: dialog whiptail basicinput
-
tinyfd_beep
public static void tinyfd_beep()
-
ntinyfd_notifyPopup
public static int ntinyfd_notifyPopup(long aTitle, long aMessage, long aIconType)Unsafe version of:notifyPopup
-
tinyfd_notifyPopup
public static int tinyfd_notifyPopup(@Nullable java.nio.ByteBuffer aTitle, @Nullable java.nio.ByteBuffer aMessage, java.nio.ByteBuffer aIconType) public static int tinyfd_notifyPopup(@Nullable java.lang.CharSequence aTitle, @Nullable java.lang.CharSequence aMessage, java.lang.CharSequence aIconType)Displays a notification popup.- Parameters:
aTitle- the dialog title orNULLaMessage- the message orNULL. It may contain \n and \t characters.aIconType- the icon type. One of:"info" "warning" "error"
-
ntinyfd_messageBox
public static int ntinyfd_messageBox(long aTitle, long aMessage, long aDialogType, long aIconType, int aDefaultButton)Unsafe version of:messageBox
-
tinyfd_messageBox
public static boolean tinyfd_messageBox(@Nullable java.nio.ByteBuffer aTitle, @Nullable java.nio.ByteBuffer aMessage, java.nio.ByteBuffer aDialogType, java.nio.ByteBuffer aIconType, boolean aDefaultButton) public static boolean tinyfd_messageBox(@Nullable java.lang.CharSequence aTitle, @Nullable java.lang.CharSequence aMessage, java.lang.CharSequence aDialogType, java.lang.CharSequence aIconType, boolean aDefaultButton)Displays a message dialog.- Parameters:
aTitle- the dialog title orNULLaMessage- the message orNULL. It may contain \n and \t characters.aDialogType- the dialog type. One of:"ok" "okcancel" "yesno" "yesnocancel" aIconType- the icon type. One of:"info" "warning" "error" "question" aDefaultButton- 0 for cancel/no, 1 for ok/yes- Returns:
- 0 for cancel/no, 1 for ok/yes, 2 for no in yesnocancel
-
ntinyfd_inputBox
public static long ntinyfd_inputBox(long aTitle, long aMessage, long aDefaultInput)Unsafe version of:inputBox
-
tinyfd_inputBox
@Nullable public static java.lang.String tinyfd_inputBox(@Nullable java.nio.ByteBuffer aTitle, @Nullable java.nio.ByteBuffer aMessage, @Nullable java.nio.ByteBuffer aDefaultInput) @Nullable public static java.lang.String tinyfd_inputBox(@Nullable java.lang.CharSequence aTitle, @Nullable java.lang.CharSequence aMessage, @Nullable java.lang.CharSequence aDefaultInput)Displays an input dialog.- Parameters:
aTitle- the dialog title orNULLaMessage- the message orNULL. May NOT contain \n and \t characters on Windows.aDefaultInput- ifNULLit's a password box- Returns:
- the input value or
NULLon cancel
-
ntinyfd_saveFileDialog
public static long ntinyfd_saveFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription)Unsafe version of:saveFileDialog- Parameters:
aNumOfFilterPatterns- the number of patterns inaFilterPatterns
-
tinyfd_saveFileDialog
@Nullable public static java.lang.String tinyfd_saveFileDialog(@Nullable java.nio.ByteBuffer aTitle, @Nullable java.nio.ByteBuffer aDefaultPathAndFile, @Nullable org.lwjgl.PointerBuffer aFilterPatterns, @Nullable java.nio.ByteBuffer aSingleFilterDescription) @Nullable public static java.lang.String tinyfd_saveFileDialog(@Nullable java.lang.CharSequence aTitle, @Nullable java.lang.CharSequence aDefaultPathAndFile, @Nullable org.lwjgl.PointerBuffer aFilterPatterns, @Nullable java.lang.CharSequence aSingleFilterDescription)Displays a file save dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultPathAndFile- the default path and/or file orNULLaFilterPatterns- an array of file type patterns (NULLor {"*.jpg","*.png"}aSingleFilterDescription-NULLor "image files"- Returns:
- the selected file path or
NULLon cancel
-
ntinyfd_openFileDialog
public static long ntinyfd_openFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription, int aAllowMultipleSelects)Unsafe version of:openFileDialog- Parameters:
aNumOfFilterPatterns- the number of patterns inaFilterPatterns
-
tinyfd_openFileDialog
@Nullable public static java.lang.String tinyfd_openFileDialog(@Nullable java.nio.ByteBuffer aTitle, @Nullable java.nio.ByteBuffer aDefaultPathAndFile, @Nullable org.lwjgl.PointerBuffer aFilterPatterns, @Nullable java.nio.ByteBuffer aSingleFilterDescription, boolean aAllowMultipleSelects) @Nullable public static java.lang.String tinyfd_openFileDialog(@Nullable java.lang.CharSequence aTitle, @Nullable java.lang.CharSequence aDefaultPathAndFile, @Nullable org.lwjgl.PointerBuffer aFilterPatterns, @Nullable java.lang.CharSequence aSingleFilterDescription, boolean aAllowMultipleSelects)Displays a file open dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultPathAndFile- the default path and/or file orNULLaFilterPatterns- an array of file type patterns (NULLor {"*.jpg","*.png"}aSingleFilterDescription-NULLor "image files"aAllowMultipleSelects- if true, multiple selections are allowed- Returns:
- the file(s) selected or
NULLon cancel. In case of multiple files, the separator is '|'.
-
ntinyfd_selectFolderDialog
public static long ntinyfd_selectFolderDialog(long aTitle, long aDefaultPath)Unsafe version of:selectFolderDialog
-
tinyfd_selectFolderDialog
@Nullable public static java.lang.String tinyfd_selectFolderDialog(@Nullable java.nio.ByteBuffer aTitle, java.nio.ByteBuffer aDefaultPath) @Nullable public static java.lang.String tinyfd_selectFolderDialog(@Nullable java.lang.CharSequence aTitle, java.lang.CharSequence aDefaultPath)Displays a folder selection dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultPath- the default path orNULL
-
ntinyfd_colorChooser
public static long ntinyfd_colorChooser(long aTitle, long aDefaultHexRGB, long aDefaultRGB, long aoResultRGB)Unsafe version of:colorChooser
-
tinyfd_colorChooser
@Nullable public static java.lang.String tinyfd_colorChooser(@Nullable java.nio.ByteBuffer aTitle, @Nullable java.nio.ByteBuffer aDefaultHexRGB, @Nullable java.nio.ByteBuffer aDefaultRGB, java.nio.ByteBuffer aoResultRGB) @Nullable public static java.lang.String tinyfd_colorChooser(@Nullable java.lang.CharSequence aTitle, @Nullable java.lang.CharSequence aDefaultHexRGB, @Nullable java.nio.ByteBuffer aDefaultRGB, java.nio.ByteBuffer aoResultRGB)Displays a color chooser dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultHexRGB-NULLor "#FF0000"aDefaultRGB- { 0 , 255 , 255 }. Used only ifaDefaultHexRGBisNULL.aoResultRGB- returns the selected color.aDefaultRGBandaoResultRGBcan be the same array.- Returns:
- the selected hexcolor as a string "#FF0000" or
NULLon cancel
-
-