Subversion Repositories spk

Rev

Rev 226 | Rev 248 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 226 Rev 237
Line 3... Line 3...
3
#include "InputBox.h"
3
#include "InputBox.h"
4
#include "Form1.h"
4
#include "Form1.h"
5
#include "AddWareText.h"
5
#include "AddWareText.h"
6
#include "AddCockpit.h"
6
#include "AddCockpit.h"
7
#include "SaveDialog.h"
7
#include "SaveDialog.h"
-
 
8
#include "AddGlobal.h"
8
 
9
 
9
#include <Package/InstallText.h>
10
#include <Package/InstallText.h>
10
 
11
 
11
namespace Creator {
12
namespace Creator {
12
	void PackageForm::_init() 
13
	void PackageForm::_init() 
Line 15... Line 16...
15
		this->TextExactVersion->Visible = false;
16
		this->TextExactVersion->Visible = false;
16
		this->DoToolTips();
17
		this->DoToolTips();
17
 
18
 
18
		this->ListDep->LargeImageList = this->imageList1;
19
		this->ListDep->LargeImageList = this->imageList1;
19
		this->ListDep->SmallImageList = this->imageList1;
20
		this->ListDep->SmallImageList = this->imageList1;
-
 
21
		this->listGlobals->LargeImageList = this->imageList1;
-
 
22
		this->listGlobals->SmallImageList = this->imageList1;
20
 
23
 
21
		m_iFormType = FORMTYPE_SINGLE;
24
		m_iFormType = FORMTYPE_SINGLE;
22
		m_pDisplayFile = NULL;
25
		m_pDisplayFile = NULL;
23
 
26
 
24
		this->NumTextID->Visible = false;
27
		this->NumTextID->Visible = false;
Line 475... Line 478...
475
		this->UpdateDisplayPic();
478
		this->UpdateDisplayPic();
476
		this->UpdateDisplayIcon();
479
		this->UpdateDisplayIcon();
477
		this->UpdateRatings();
480
		this->UpdateRatings();
478
		this->UpdateText();
481
		this->UpdateText();
479
		this->UpdateDependacies();
482
		this->UpdateDependacies();
-
 
483
		this->UpdateGlobals();
480
 
484
 
481
		// delete the pages
485
		// delete the pages
482
		if ( m_pPackage->GetType() != TYPE_XSP )
486
		if ( m_pPackage->GetType() != TYPE_XSP )
483
		{
487
		{
484
			delete this->PageShip;
488
			delete this->PageShip;
Line 513... Line 517...
513
			this->ListDep->Items->Add(item);
517
			this->ListDep->Items->Add(item);
514
		}
518
		}
515
		this->ListDep->AutoResizeColumns(ColumnHeaderAutoResizeStyle::HeaderSize);
519
		this->ListDep->AutoResizeColumns(ColumnHeaderAutoResizeStyle::HeaderSize);
516
	}
520
	}
517
 
521
 
-
 
522
	void PackageForm::UpdateGlobals()
-
 
523
	{
-
 
524
		this->listGlobals->Items->Clear();
-
 
525
		auto& list = m_pPackage->getGlobals();
-
 
526
		for (auto itr = list.begin(); itr != list.end(); itr++)
-
 
527
		{
-
 
528
			ListViewItem^ item = gcnew ListViewItem(_US((*itr)->str));
-
 
529
			item->SubItems->Add(_US((*itr)->data));
-
 
530
			item->ImageIndex = 3;
-
 
531
			this->listGlobals->Items->Add(item);
-
 
532
		}
-
 
533
	}
-
 
534
 
518
	void PackageForm::UpdateShipPartList()
535
	void PackageForm::UpdateShipPartList()
519
	{
536
	{
520
		if ( !m_pPackage )
537
		if ( !m_pPackage )
521
			return;
538
			return;
522
		CXspFile *xsp = (CXspFile *)m_pPackage;
539
		CXspFile *xsp = (CXspFile *)m_pPackage;
Line 1902... Line 1919...
1902
				this->UpdateChanged();
1919
				this->UpdateChanged();
1903
			}
1920
			}
1904
		}
1921
		}
1905
	}
1922
	}
1906
 
1923
 
-
 
1924
	void PackageForm::EditGlobal()
-
 
1925
	{
-
 
1926
		AddGlobal^ global = gcnew AddGlobal();
-
 
1927
		global->SetEdit(m_pSelectedItem->Text, m_pSelectedItem->SubItems[1]->Text);
-
 
1928
 
-
 
1929
		if (global->ShowDialog(this) == Windows::Forms::DialogResult::OK)
-
 
1930
		{
-
 
1931
			m_pPackage->removeGlobal(_WS(global->GetName()));
-
 
1932
			m_pPackage->addGlobal(_WS(global->GetName()), _WS(global->GetData()));
-
 
1933
 
-
 
1934
			this->UpdateGlobals();
-
 
1935
			this->UpdateChanged();
-
 
1936
		}
-
 
1937
 
-
 
1938
		this->UpdateDependacies();
-
 
1939
		this->UpdateChanged();
-
 
1940
	}
-
 
1941
 
-
 
1942
	void PackageForm::AddNewGlobal()
-
 
1943
	{
-
 
1944
		AddGlobal^ global = gcnew AddGlobal();
-
 
1945
		if (global->ShowDialog(this) == Windows::Forms::DialogResult::OK)
-
 
1946
		{
-
 
1947
			m_pPackage->addGlobal(_WS(global->GetName()), _WS(global->GetData()));
-
 
1948
			this->UpdateGlobals();
-
 
1949
			this->UpdateChanged();
-
 
1950
		}
-
 
1951
	}
-
 
1952
 
1907
	void PackageForm::EditDepend()
1953
	void PackageForm::EditDepend()
1908
	{
1954
	{
1909
		 AddDepend ^depend = gcnew AddDepend();
1955
		 AddDepend ^depend = gcnew AddDepend();
1910
		 depend->SetEdit(m_pSelectedItem->Text, m_pSelectedItem->SubItems[1]->Text, m_pSelectedItem->SubItems[2]->Text);
1956
		 depend->SetEdit(m_pSelectedItem->Text, m_pSelectedItem->SubItems[1]->Text, m_pSelectedItem->SubItems[2]->Text);
1911
 
1957