Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | NumInput |
Macros | |
#define | NUM_STR_REP_LEN 64 |
#define | NUM_MAX_ELEMENTS 3 |
Typedefs | |
typedef struct NumInput | NumInput |
Enumerations | |
enum | { NUM_AFFECT_ALL = (1 << 0) } |
enum | { NUM_NULL_ONE = (1 << 0) , NUM_NO_NEGATIVE = (1 << 1) , NUM_NO_ZERO = (1 << 2) , NUM_NO_FRACTION = (1 << 3) } |
NumInput | |
#define | NUM_MODAL_INCREMENT_UP 18 |
#define | NUM_MODAL_INCREMENT_DOWN 19 |
void | initNumInput (NumInput *n) |
void | outputNumInput (NumInput *n, char *str, struct UnitSettings *unit_settings) |
bool | hasNumInput (const NumInput *n) |
bool | applyNumInput (NumInput *n, float *vec) |
bool | handleNumInput (struct bContext *C, NumInput *n, const struct wmEvent *event) |
bool | user_string_to_number (bContext *C, const char *str, const struct UnitSettings *unit, int type, double *r_value, bool use_single_line_error, char **r_error) |
#define NUM_MAX_ELEMENTS 3 |
Definition at line 14 of file ED_numinput.h.
#define NUM_MODAL_INCREMENT_DOWN 19 |
Definition at line 96 of file ED_numinput.h.
#define NUM_MODAL_INCREMENT_UP 18 |
Share with TFM_MODAL_CANCEL
in transform.h
.
Definition at line 95 of file ED_numinput.h.
#define NUM_STR_REP_LEN 64 |
Definition at line 13 of file ED_numinput.h.
anonymous enum |
anonymous enum |
Enumerator | |
---|---|
NUM_NULL_ONE | |
NUM_NO_NEGATIVE | |
NUM_NO_ZERO | |
NUM_NO_FRACTION |
Definition at line 53 of file ED_numinput.h.
Definition at line 189 of file numinput.c.
References NumInput::flag, floorf, hasNumInput(), NumInput::idx, NumInput::idx_max, NUM_AFFECT_ALL, NUM_EDITED, NUM_FAKE_EDITED, NUM_NO_FRACTION, NUM_NO_NEGATIVE, NUM_NO_ZERO, NUM_NULL_ONE, NumInput::val, NumInput::val_flag, and NumInput::val_org.
Referenced by applyBakeTime(), applyBevelWeight(), applyBoneEnvelope(), applyBoneRoll(), applyBoneSize(), applyCrease(), applyCurveShrinkFatten(), applyEdgeSlide(), applyGPOpacity(), applyGPShrinkFatten(), applyMaskShrinkFatten(), applyNormalRotation(), applyPushPull(), applyResize(), applyRotation(), applySeqSlide(), applyShear(), applyShrinkFatten(), applySkinResize(), applyTilt(), applyTimeScale(), applyTimeSlide(), applyTimeTranslate(), applyToSphere(), applyTrackball(), applyTranslation(), applyVertSlide(), Bend(), ed_marker_move_modal(), edbm_bevel_numinput_set_value(), edbm_inset_modal(), ElementResize(), gpencil_interpolate_modal(), gpencil_primitive_modal(), graph_slider_modal(), knifetool_modal(), loopcut_modal(), pose_slide_modal(), radial_control_modal(), and sequencer_slip_modal().
Definition at line 170 of file numinput.c.
References NumInput::flag, NumInput::idx_max, NUM_EDITED, NUM_FAKE_EDITED, and NumInput::val_flag.
Referenced by applyBakeTime(), applyBevelWeight(), applyBoneEnvelope(), applyBoneRoll(), applyCrease(), applyCurveShrinkFatten(), applyEdgeSlide(), applyGPOpacity(), applyGPShrinkFatten(), applyMaskShrinkFatten(), applyNumInput(), applyPushPull(), applyRotation(), applyShear(), applyShrinkFatten(), applyTilt(), applyToSphere(), applyTrackball(), applyVertSlide(), Bend(), blend_to_default_draw_status_header(), blend_to_neighbor_draw_status_header(), breakdown_draw_status_header(), constraints_rotation_impl(), decimate_draw_status(), ed_marker_move_modal(), ed_marker_move_update_header(), edbm_bevel_modal(), edbm_inset_modal(), edbm_inset_update_header(), gpencil_interpolate_modal(), gpencil_interpolate_status_indicators(), gpencil_primitive_modal(), gpencil_primitive_status_indicators(), graph_slider_modal(), headerBoneSize(), headerResize(), headerRotation(), headerSeqSlide(), headerTimeScale(), headerTimeSlide(), headerTimeTranslate(), headerTranslation(), knifetool_modal(), loopcut_modal(), pose_slide_draw_status(), pose_slide_modal(), radial_control_modal(), radial_control_update_header(), sequencer_slip_modal(), sequencer_slip_update_header(), and transformEvent().
There are important things to note here for code using numeric-input:
bool
returned by applyNumInput should be used to decide whether to apply numeric-input-specific post-process to data.drawstr
source or not (i.e. to call outputNumInput).Those two steps have to be separated (so do not use a common call to hasNumInput() to do both in the same time!).
Definition at line 69 of file numinput.c.
References B_UNIT_NONE, copy_vn_fl(), copy_vn_i(), copy_vn_short(), NumInput::flag, NumInput::idx, NumInput::idx_max, NUM_MAX_ELEMENTS, NumInput::str, NumInput::str_cur, NumInput::unit_sys, NumInput::unit_type, NumInput::unit_use_radians, USER_UNIT_NONE, NumInput::val, NumInput::val_flag, NumInput::val_inc, NumInput::val_org, and zero_v3().
Referenced by ed_marker_move_init(), edbm_bevel_init(), edbm_inset_init(), initTransInfo(), knifetool_init(), pose_slide_init(), radial_control_invoke(), ringsel_init(), and sequencer_slip_invoke().
void outputNumInput | ( | NumInput * | n, |
char * | str, | ||
struct UnitSettings * | unit_settings | ||
) |
str | Must be NUM_STR_REP_LEN * (idx_max + 1) length. |
Definition at line 87 of file numinput.c.
References B_UNIT_ROTATION, BKE_scene_unit_scale(), BKE_unit_value_as_string_adaptive(), BLI_snprintf(), BLI_str_utf8_invalid_strip(), BLI_strncpy(), NumInput::flag, float(), NumInput::idx, NumInput::idx_max, NUM_AFFECT_ALL, NUM_EDITED, NUM_INVALID, NUM_INVERSE, NUM_NEGATE, NUM_STR_REP_LEN, str, NumInput::str, NumInput::str_cur, UI_calc_float_precision(), NumInput::unit_sys, NumInput::unit_type, NumInput::unit_use_radians, NumInput::val, and NumInput::val_flag.
Referenced by applyBakeTime(), applyBevelWeight(), applyBoneEnvelope(), applyBoneRoll(), applyCrease(), applyCurveShrinkFatten(), applyEdgeSlide(), applyGPOpacity(), applyGPShrinkFatten(), applyMaskShrinkFatten(), applyPushPull(), applyShear(), applyShrinkFatten(), applyTilt(), applyToSphere(), applyTrackball(), applyVertSlide(), Bend(), blend_to_default_draw_status_header(), blend_to_neighbor_draw_status_header(), breakdown_draw_status_header(), decimate_draw_status(), ed_marker_move_update_header(), edbm_inset_update_header(), gpencil_interpolate_status_indicators(), gpencil_primitive_status_indicators(), headerBoneSize(), headerResize(), headerRotation(), headerSeqSlide(), headerTimeScale(), headerTimeSlide(), headerTimeTranslate(), headerTranslation(), loopcut_modal(), pose_slide_draw_status(), radial_control_update_header(), and sequencer_slip_update_header().
bool user_string_to_number | ( | bContext * | C, |
const char * | str, | ||
const struct UnitSettings * | unit, | ||
int | type, | ||
double * | r_value, | ||
bool | use_single_line_error, | ||
char ** | r_error | ||
) |
Referenced by ui_number_from_string_units().