LUAEditorGoToLineDialog.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "LUAEditorGoToLineDialog.hxx"
  9. #include <Source/LUA/moc_LUAEditorGoToLineDialog.cpp>
  10. #include <Source/LUA/ui_LUAEditorGoToLineDialog.h>
  11. namespace LUAEditor
  12. {
  13. LUAEditorGoToLineDialog::LUAEditorGoToLineDialog(QWidget* parent)
  14. : QDialog(parent)
  15. {
  16. m_lineNumber = 0;
  17. m_gui = azcreate(Ui::goToLineDlg, ());
  18. m_gui->setupUi(this);
  19. this->setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
  20. connect(m_gui->lineNumberSpinBox, SIGNAL(valueChanged (int)), this, SLOT(spinBoxLineNumberChanged(int)));
  21. }
  22. LUAEditorGoToLineDialog::~LUAEditorGoToLineDialog()
  23. {
  24. azdestroy(m_gui);
  25. }
  26. void LUAEditorGoToLineDialog::setLineNumber(int newNumber)
  27. {
  28. m_gui->lineNumberSpinBox->setValue(newNumber);
  29. m_gui->lineNumberSpinBox->setFocus();
  30. m_gui->lineNumberSpinBox->selectAll();
  31. }
  32. void LUAEditorGoToLineDialog::spinBoxLineNumberChanged(int newNumber)
  33. {
  34. m_lineNumber = newNumber;
  35. emit lineNumberChanged(newNumber);
  36. }
  37. }