mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
5fd921e9e6
Dialogs.h: remove static from redrawGUI and toggleTooltips. And changes because of this. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4517 a592a061-630c-0410-9148-cb99ea01b6c8
71 lines
1.7 KiB
C
71 lines
1.7 KiB
C
/**
|
|
* \file FormSearch.C
|
|
* Copyright 2001 The LyX Team.
|
|
* See the file COPYING.
|
|
*
|
|
* \author Edwin Leuven, leuven@fee.uva.nl
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#ifdef __GNUG__
|
|
#pragma implementation
|
|
#endif
|
|
|
|
#include "xformsBC.h"
|
|
#include "ControlSearch.h"
|
|
#include "FormSearch.h"
|
|
#include "forms/form_search.h"
|
|
#include FORMS_H_LOCATION
|
|
|
|
typedef FormCB<ControlSearch, FormDB<FD_search> > base_class;
|
|
|
|
FormSearch::FormSearch(ControlSearch & c, Dialogs & d)
|
|
: base_class(c, d, _("LyX: Find and Replace"))
|
|
{}
|
|
|
|
|
|
void FormSearch::build()
|
|
{
|
|
dialog_.reset(build_search(this));
|
|
|
|
// Manage the ok, apply and cancel/close buttons
|
|
bc().setCancel(dialog_->button_close);
|
|
bc().addReadOnly(dialog_->input_replace);
|
|
bc().addReadOnly(dialog_->button_replace);
|
|
bc().addReadOnly(dialog_->button_replaceall);
|
|
}
|
|
|
|
|
|
void FormSearch::update()
|
|
{
|
|
fl_set_input_selected(dialog_->input_search, true);
|
|
fl_set_focus_object(dialog_->form, dialog_->input_search);
|
|
}
|
|
|
|
|
|
ButtonPolicy::SMInput FormSearch::input(FL_OBJECT * obj, long)
|
|
{
|
|
if (obj == dialog_->button_findnext ||
|
|
obj == dialog_->button_findprev) {
|
|
bool const forward = (obj == dialog_->button_findnext);
|
|
|
|
controller().find(fl_get_input(dialog_->input_search),
|
|
fl_get_button(dialog_->check_casesensitive),
|
|
fl_get_button(dialog_->check_matchword),
|
|
forward);
|
|
|
|
} else if (obj == dialog_->button_replace ||
|
|
obj == dialog_->button_replaceall) {
|
|
bool const all = (obj == dialog_->button_replaceall);
|
|
|
|
controller().replace(fl_get_input(dialog_->input_search),
|
|
fl_get_input(dialog_->input_replace),
|
|
fl_get_button(dialog_->check_casesensitive),
|
|
fl_get_button(dialog_->check_matchword),
|
|
all);
|
|
}
|
|
|
|
return ButtonPolicy::SMI_VALID;
|
|
}
|