~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to source/blender/editors/space_text/text_header.c

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
#include "BLI_blenlib.h"
44
44
 
 
45
#include "BLF_translation.h"
 
46
 
45
47
#include "BKE_context.h"
46
48
#include "BKE_screen.h"
47
49
 
111
113
        ot->poll = text_properties_poll;
112
114
}
113
115
 
 
116
static int text_text_search_exec(bContext *C, wmOperator *UNUSED(op))
 
117
{
 
118
        ScrArea *sa = CTX_wm_area(C);
 
119
        ARegion *ar = text_has_properties_region(sa);
 
120
        SpaceText *st = CTX_wm_space_text(C);
 
121
        
 
122
        if (ar) {
 
123
                if (ar->flag & RGN_FLAG_HIDDEN)
 
124
                        ED_region_toggle_hidden(C, ar);
 
125
                
 
126
                /* cannot send a button activate yet for case when region wasn't visible yet */
 
127
                /* flag gets checked and cleared in main draw callback */
 
128
                st->flags |= ST_FIND_ACTIVATE;
 
129
                
 
130
                ED_region_tag_redraw(ar);
 
131
        }
 
132
        return OPERATOR_FINISHED;
 
133
}
 
134
 
 
135
 
 
136
void TEXT_OT_start_find(wmOperatorType *ot)
 
137
{
 
138
        /* identifiers */
 
139
        ot->name = "Find";
 
140
        ot->description = "Start searching text";
 
141
        ot->idname = "TEXT_OT_start_find";
 
142
        
 
143
        /* api callbacks */
 
144
        ot->exec = text_text_search_exec;
 
145
        ot->poll = text_properties_poll;
 
146
}
 
147
 
114
148
/******************** XXX popup menus *******************/
115
149
 
116
150
#if 0
120
154
        uiPopupMenu *pup;
121
155
 
122
156
        if (text) {
123
 
                pup = uiPupMenuBegin(C, "Text", ICON_NONE);
 
157
                pup = uiPupMenuBegin(C, IFACE_("Text"), ICON_NONE);
124
158
                if (txt_has_sel(text)) {
125
159
                        uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_cut");
126
160
                        uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_copy");
134
168
                uiPupMenuEnd(C, pup);
135
169
        }
136
170
        else {
137
 
                pup = uiPupMenuBegin(C, "File", ICON_NONE);
 
171
                pup = uiPupMenuBegin(C, IFACE_("File"), ICON_NONE);
138
172
                uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
139
173
                uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
140
174
                uiPupMenuEnd(C, pup);
146
180
 
147
181
        uiPopupMenu *pup;
148
182
 
149
 
        pup = uiPupMenuBegin(C, "Edit", ICON_NONE);
 
183
        pup = uiPupMenuBegin(C, IFACE_("Edit"), ICON_NONE);
150
184
        uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_cut");
151
185
        uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_copy");
152
186
        uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_paste");
159
193
        uiPopupMenu *pup;
160
194
 
161
195
        if (text) {
162
 
                pup = uiPupMenuBegin(C, "Text", ICON_NONE);
 
196
                pup = uiPupMenuBegin(C, IFACE_("Text"), ICON_NONE);
163
197
                uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
164
198
                uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
165
199
                uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_save");
168
202
                uiPupMenuEnd(C, pup);
169
203
        }
170
204
        else {
171
 
                pup = uiPupMenuBegin(C, "File", ICON_NONE);
 
205
                pup = uiPupMenuBegin(C, IFACE_("File"), ICON_NONE);
172
206
                uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_new");
173
207
                uiItemO(layout, NULL, ICON_NONE, "TEXT_OT_open");
174
208
                uiPupMenuEnd(C, pup);
180
214
 
181
215
        uiPopupMenu *pup;
182
216
 
183
 
        pup = uiPupMenuBegin(C, "Text", ICON_NONE);
184
 
        uiItemEnumO(layout, "TEXT_OT_move", "Top of File", 0, "type", FILE_TOP);
185
 
        uiItemEnumO(layout, "TEXT_OT_move", "Bottom of File", 0, "type", FILE_BOTTOM);
186
 
        uiItemEnumO(layout, "TEXT_OT_move", "Page Up", 0, "type", PREV_PAGE);
187
 
        uiItemEnumO(layout, "TEXT_OT_move", "Page Down", 0, "type", NEXT_PAGE);
 
217
        pup = uiPupMenuBegin(C, IFACE_("Text"), ICON_NONE);
 
218
        uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Top of File"),
 
219
                    0, "type", FILE_TOP);
 
220
        uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Bottom of File"),
 
221
                    0, "type", FILE_BOTTOM);
 
222
        uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Page Up"), 0, "type", PREV_PAGE);
 
223
        uiItemEnumO(layout, "TEXT_OT_move", CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Page Down"),
 
224
                    0, "type", NEXT_PAGE);
188
225
        uiPupMenuEnd(C, pup);
189
226
}
190
227
#endif