mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-12 03:23:12 +00:00
Use Dispatch in FormTabCreate, some minor tidying.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1325 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0f4053721e
commit
0c2bbc6801
@ -0,0 +1,11 @@
|
|||||||
|
2000-01-12 John Levon <moz@compsoc.man.ac.uk>
|
||||||
|
|
||||||
|
* FormTabularCreate.C: use LFUN_INSET_TABULAR Dispatch
|
||||||
|
instead of creating by hand
|
||||||
|
|
||||||
|
* FormUrl.C: add accelerators for Close and Cancel
|
||||||
|
|
||||||
|
* paradlg.C: add accelerators for Close and Cancel,
|
||||||
|
clean the code up a little
|
||||||
|
|
||||||
|
* printdlg.C: add FIXME for later
|
@ -22,6 +22,7 @@
|
|||||||
#include "QtLyXView.h"
|
#include "QtLyXView.h"
|
||||||
#include "BufferView.h"
|
#include "BufferView.h"
|
||||||
#include "insets/insettabular.h"
|
#include "insets/insettabular.h"
|
||||||
|
#include "support/lstrings.h"
|
||||||
|
|
||||||
FormTabularCreate::FormTabularCreate(LyXView *v, Dialogs *d)
|
FormTabularCreate::FormTabularCreate(LyXView *v, Dialogs *d)
|
||||||
: dialog_(0), lv_(v), d_(d), h_(0)
|
: dialog_(0), lv_(v), d_(d), h_(0)
|
||||||
@ -42,9 +43,8 @@ void FormTabularCreate::apply(unsigned int rows, unsigned cols)
|
|||||||
if (!lv_->view()->available())
|
if (!lv_->view()->available())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
InsetTabular * in = new InsetTabular(*lv_->buffer(), rows, cols);
|
string tmp = tostr(rows) + " " + tostr(cols);
|
||||||
if (!lv_->view()->open_new_inset(in))
|
lv_->getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, tmp);
|
||||||
delete in;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormTabularCreate::show()
|
void FormTabularCreate::show()
|
||||||
|
@ -83,14 +83,14 @@ void FormUrl::update(bool switched)
|
|||||||
dialog_->urlname->setFocusPolicy(QWidget::NoFocus);
|
dialog_->urlname->setFocusPolicy(QWidget::NoFocus);
|
||||||
dialog_->url->setFocusPolicy(QWidget::NoFocus);
|
dialog_->url->setFocusPolicy(QWidget::NoFocus);
|
||||||
dialog_->buttonOk->setEnabled(false);
|
dialog_->buttonOk->setEnabled(false);
|
||||||
dialog_->buttonCancel->setText(_("Close"));
|
dialog_->buttonCancel->setText(_("&Close"));
|
||||||
dialog_->htmlurl->setEnabled(false);
|
dialog_->htmlurl->setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
dialog_->urlname->setFocusPolicy(QWidget::StrongFocus);
|
dialog_->urlname->setFocusPolicy(QWidget::StrongFocus);
|
||||||
dialog_->url->setFocusPolicy(QWidget::StrongFocus);
|
dialog_->url->setFocusPolicy(QWidget::StrongFocus);
|
||||||
dialog_->url->setFocus();
|
dialog_->url->setFocus();
|
||||||
dialog_->buttonOk->setEnabled(true);
|
dialog_->buttonOk->setEnabled(true);
|
||||||
dialog_->buttonCancel->setText(_("Cancel"));
|
dialog_->buttonCancel->setText(_("&Cancel"));
|
||||||
dialog_->htmlurl->setEnabled(true);
|
dialog_->htmlurl->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ void ParaDialog::setReadOnly(bool readonly)
|
|||||||
ok->setEnabled(!readonly);
|
ok->setEnabled(!readonly);
|
||||||
apply->setEnabled(!readonly);
|
apply->setEnabled(!readonly);
|
||||||
restore->setEnabled(!readonly);
|
restore->setEnabled(!readonly);
|
||||||
cancel->setText(readonly ? _("Close") : _("Cancel"));
|
cancel->setText(readonly ? _("&Close") : _("&Cancel"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParaDialog::setLabelWidth(const char *text)
|
void ParaDialog::setLabelWidth(const char *text)
|
||||||
@ -130,52 +130,29 @@ void ParaDialog::setChecks(bool labove, bool lbelow, bool pabove, bool pbelow, b
|
|||||||
|
|
||||||
void ParaDialog::setSpace(VSpace::vspace_kind kindabove, VSpace::vspace_kind kindbelow, bool keepabove, bool keepbelow)
|
void ParaDialog::setSpace(VSpace::vspace_kind kindabove, VSpace::vspace_kind kindbelow, bool keepabove, bool keepbelow)
|
||||||
{
|
{
|
||||||
|
int item;
|
||||||
|
|
||||||
switch (kindabove) {
|
switch (kindabove) {
|
||||||
case VSpace::NONE:
|
case VSpace::NONE: item = 0; break;
|
||||||
generalpage->abovepage->spaceabove->setCurrentItem(0);
|
case VSpace::DEFSKIP: item = 1; break;
|
||||||
break;
|
case VSpace::SMALLSKIP: item = 2; break;
|
||||||
case VSpace::DEFSKIP:
|
case VSpace::MEDSKIP: item = 3; break;
|
||||||
generalpage->abovepage->spaceabove->setCurrentItem(1);
|
case VSpace::BIGSKIP: item = 4; break;
|
||||||
break;
|
case VSpace::VFILL: item = 5; break;
|
||||||
case VSpace::SMALLSKIP:
|
case VSpace::LENGTH: item = 6; break;
|
||||||
generalpage->abovepage->spaceabove->setCurrentItem(2);
|
|
||||||
break;
|
|
||||||
case VSpace::MEDSKIP:
|
|
||||||
generalpage->abovepage->spaceabove->setCurrentItem(3);
|
|
||||||
break;
|
|
||||||
case VSpace::BIGSKIP:
|
|
||||||
generalpage->abovepage->spaceabove->setCurrentItem(4);
|
|
||||||
break;
|
|
||||||
case VSpace::VFILL:
|
|
||||||
generalpage->abovepage->spaceabove->setCurrentItem(5);
|
|
||||||
break;
|
|
||||||
case VSpace::LENGTH:
|
|
||||||
generalpage->abovepage->spaceabove->setCurrentItem(6);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
generalpage->abovepage->spaceabove->setCurrentItem(item);
|
||||||
|
|
||||||
switch (kindbelow) {
|
switch (kindbelow) {
|
||||||
case VSpace::NONE:
|
case VSpace::NONE: item = 0; break;
|
||||||
generalpage->belowpage->spacebelow->setCurrentItem(0);
|
case VSpace::DEFSKIP: item = 1; break;
|
||||||
break;
|
case VSpace::SMALLSKIP: item = 2; break;
|
||||||
case VSpace::DEFSKIP:
|
case VSpace::MEDSKIP: item = 3; break;
|
||||||
generalpage->belowpage->spacebelow->setCurrentItem(1);
|
case VSpace::BIGSKIP: item = 4; break;
|
||||||
break;
|
case VSpace::VFILL: item = 5; break;
|
||||||
case VSpace::SMALLSKIP:
|
case VSpace::LENGTH: item = 6; break;
|
||||||
generalpage->belowpage->spacebelow->setCurrentItem(2);
|
|
||||||
break;
|
|
||||||
case VSpace::MEDSKIP:
|
|
||||||
generalpage->belowpage->spacebelow->setCurrentItem(3);
|
|
||||||
break;
|
|
||||||
case VSpace::BIGSKIP:
|
|
||||||
generalpage->belowpage->spacebelow->setCurrentItem(4);
|
|
||||||
break;
|
|
||||||
case VSpace::VFILL:
|
|
||||||
generalpage->belowpage->spacebelow->setCurrentItem(5);
|
|
||||||
break;
|
|
||||||
case VSpace::LENGTH:
|
|
||||||
generalpage->belowpage->spacebelow->setCurrentItem(6);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
generalpage->belowpage->spacebelow->setCurrentItem(item);
|
||||||
|
|
||||||
generalpage->abovepage->spaceabovevalue->setEnabled(kindabove == VSpace::LENGTH);
|
generalpage->abovepage->spaceabovevalue->setEnabled(kindabove == VSpace::LENGTH);
|
||||||
generalpage->abovepage->spaceabovevalueunits->setEnabled(kindabove == VSpace::LENGTH);
|
generalpage->abovepage->spaceabovevalueunits->setEnabled(kindabove == VSpace::LENGTH);
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#define Inherited PrintDialogData
|
#define Inherited PrintDialogData
|
||||||
|
|
||||||
|
/* FIXME: tab order is out of whack */
|
||||||
|
|
||||||
PrintDialog::PrintDialog(FormPrint *f, QWidget* parent, const char * name)
|
PrintDialog::PrintDialog(FormPrint *f, QWidget* parent, const char * name)
|
||||||
: PrintDialogData(parent, name), form_(f)
|
: PrintDialogData(parent, name), form_(f)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user