_dialog.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. def dialog_message_set_header(text: str, x: int, y: int, h: int, v: int) -> None:
  2. '''
  3. Set a header text on the dialog box.
  4. :param text: The text to set.
  5. :param x: The x coordinates to use.
  6. :param y: The y coordinates to use.
  7. :param h: The horizontal alignment.
  8. :param v: The vertical alignment.
  9. .. versionadded:: 1.0.0
  10. '''
  11. pass
  12. def dialog_message_set_text(text: str, x: int, y: int, h: int, v: int) -> None:
  13. '''
  14. Set a text on the dialog box.
  15. :param text: The text to set.
  16. :param x: The x coordinates to use.
  17. :param y: The y coordinates to use.
  18. :param h: The horizontal alignment.
  19. :param v: The vertical alignment.
  20. .. versionadded:: 1.0.0
  21. '''
  22. pass
  23. def dialog_message_set_button(text: str, button: int) -> None:
  24. '''
  25. Set the text of a dialog box button.
  26. :param text: The text to set.
  27. :param button: The button to use (e.g. :const:`INPUT_BUTTON_UP`).
  28. .. versionadded:: 1.0.0
  29. '''
  30. pass
  31. def dialog_message_show() -> int:
  32. '''
  33. Display the dialog box with the configured settings.
  34. This function is blocking.
  35. :returns: The button code, used to close the dialog (e.g. :const:`INPUT_BUTTON_OK`)
  36. .. versionadded:: 1.0.0
  37. .. code-block::
  38. import flipperzero as f0
  39. f0.dialog_message_set_header('Important',64, 12)
  40. f0.dialog_message_set_text('It this awesome?', 64, 24)
  41. f0.dialog_message_set_button('Yes', f0.INPUT_BUTTON_LEFT)
  42. f0.dialog_message_set_button('No', f0.INPUT_BUTTON_RIGHT)
  43. while f0.dialog_message_show() is not f0.INPUT_BUTTON_LEFT:
  44. pass
  45. '''
  46. pass