Просмотр исходного кода

Added showNext/PreviousEditor() in PolycodeFrame.

Ethan M 12 лет назад
Родитель
Сommit
6078bdda1e
2 измененных файлов с 15 добавлено и 0 удалено
  1. 2 0
      IDE/Contents/Include/PolycodeFrame.h
  2. 13 0
      IDE/Contents/Source/PolycodeFrame.cpp

+ 2 - 0
IDE/Contents/Include/PolycodeFrame.h

@@ -214,6 +214,8 @@ public:
 	
 	UIWindow *aboutWindow;
 	UIButton *aboutOKButton;
+	void showNextEditor();
+	void showPreviousEditor();
 private:
 	
 	int frameSizeX;

+ 13 - 0
IDE/Contents/Source/PolycodeFrame.cpp

@@ -917,3 +917,16 @@ PolycodeFrame::~PolycodeFrame() {
 	
 }
 
+void PolycodeFrame::showNextEditor() {
+	if (currentFileSelector->getSelectedIndex() == currentFileSelector->getNumItems()-1)
+		currentFileSelector->setSelectedIndex(0);
+	else
+		currentFileSelector->setSelectedIndex(currentFileSelector->getSelectedIndex()+1);
+}
+void PolycodeFrame::showPreviousEditor() {
+	if (currentFileSelector->getSelectedIndex() == 0)
+		currentFileSelector->setSelectedIndex(currentFileSelector->getNumItems()-1);
+	else
+		currentFileSelector->setSelectedIndex(currentFileSelector->getSelectedIndex()-1);
+}
+