* Changed Set/Get HilateCap to Set/Get HighlightCap
* Changes ReadText in CEdit to fix problem with SatCom links * Filenames when loading/saving scripts should be fixed on mxedev-ui
parent
64be7a5df6
commit
1406464f0c
|
@ -1186,7 +1186,7 @@ void CRobotMain::ChangePhase(Phase phase)
|
|||
pe->SetGenericMode(true);
|
||||
pe->SetFontType(Gfx::FONT_COLOBOT);
|
||||
pe->SetEditCap(false);
|
||||
pe->SetHiliteCap(false);
|
||||
pe->SetHighlightCap(false);
|
||||
pe->ReadText(std::string("help/win.txt"));
|
||||
}
|
||||
else
|
||||
|
|
|
@ -381,7 +381,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
|
|||
edit->ReadText(filename.c_str());
|
||||
edit->HyperHome(filename.c_str());
|
||||
edit->SetEditCap(false); // just to see!
|
||||
edit->SetHiliteCap(false);
|
||||
edit->SetHighlightCap(false);
|
||||
edit->SetFocus(true);
|
||||
|
||||
ViewDisplayInfo();
|
||||
|
@ -785,7 +785,7 @@ void CDisplayInfo::UpdateIndexButton()
|
|||
if ( edit != 0 )
|
||||
{
|
||||
//? edit->SetHiliteCap(m_index==SATCOM_LOADING);
|
||||
edit->SetHiliteCap(true);
|
||||
edit->SetHighlightCap(true);
|
||||
}
|
||||
|
||||
UpdateCopyButton();
|
||||
|
|
|
@ -786,8 +786,7 @@ void CEdit::HyperJump(std::string name, std::string marker)
|
|||
if ( name[0] == '%' ) {
|
||||
filename = GetProfile().GetUserBasedPath(name, "") + ".txt";
|
||||
} else {
|
||||
std::string path = CApplication::GetInstancePointer()->GetDataDirPath() + "/help/" + name + ".txt";
|
||||
filename = fs::path(path).generic_string();
|
||||
filename = "/help/" + name + ".txt";
|
||||
}
|
||||
|
||||
if ( ReadText(filename) )
|
||||
|
@ -1449,7 +1448,16 @@ bool CEdit::ReadText(std::string filename, int addSize)
|
|||
bool bInSoluce, bBOL;
|
||||
|
||||
if ( filename[0] == 0 ) return false;
|
||||
file = fopen(filename.c_str(), "rb");
|
||||
boost::replace_all(filename, "\\", "/");
|
||||
|
||||
/* This is ugly but doesn't require many changes in code. If file doesn't
|
||||
exists it's posible filename is absolute not full path */
|
||||
std::string path = filename;
|
||||
if (!fs::exists(path)) {
|
||||
path = CApplication::GetInstancePointer()->GetDataDirPath() + "/" + filename;
|
||||
}
|
||||
|
||||
file = fopen(fs::path(path).make_preferred().string().c_str(), "rb");
|
||||
if ( file == NULL ) return false;
|
||||
|
||||
fseek(file, 0, SEEK_END);
|
||||
|
@ -1974,12 +1982,12 @@ bool CEdit::GetEditCap()
|
|||
|
||||
// Mode management "hilitable" (that's the franch).
|
||||
|
||||
void CEdit::SetHiliteCap(bool bEnable)
|
||||
void CEdit::SetHighlightCap(bool bEnable)
|
||||
{
|
||||
m_bHilite = bEnable;
|
||||
}
|
||||
|
||||
bool CEdit::GetHiliteCap()
|
||||
bool CEdit::GetHighlightCap()
|
||||
{
|
||||
return m_bHilite;
|
||||
}
|
||||
|
|
|
@ -155,8 +155,8 @@ public:
|
|||
void SetEditCap(bool bMode);
|
||||
bool GetEditCap();
|
||||
|
||||
void SetHiliteCap(bool bEnable);
|
||||
bool GetHiliteCap();
|
||||
void SetHighlightCap(bool bEnable);
|
||||
bool GetHighlightCap();
|
||||
|
||||
void SetInsideScroll(bool bInside);
|
||||
bool GetInsideScroll();
|
||||
|
|
|
@ -891,7 +891,7 @@ pb->SetState(STATE_SHADOW);
|
|||
pe->SetState(STATE_SHADOW);
|
||||
pe->SetMaxChar(500);
|
||||
pe->SetEditCap(false); // just to see
|
||||
pe->SetHiliteCap(false);
|
||||
pe->SetHighlightCap(false);
|
||||
|
||||
// Button displays the "soluce":
|
||||
if ( m_phase != PHASE_TRAINER &&
|
||||
|
@ -1815,7 +1815,7 @@ pos.y -= 0.048f;
|
|||
pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT1);
|
||||
pe->SetGenericMode(true);
|
||||
pe->SetEditCap(false);
|
||||
pe->SetHiliteCap(false);
|
||||
pe->SetHighlightCap(false);
|
||||
pe->SetFontType(Gfx::FONT_COURIER);
|
||||
pe->SetFontSize(8.0f);
|
||||
pe->ReadText("help/authors.txt");
|
||||
|
@ -1827,7 +1827,7 @@ pos.y -= 0.048f;
|
|||
pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT2);
|
||||
pe->SetGenericMode(true);
|
||||
pe->SetEditCap(false);
|
||||
pe->SetHiliteCap(false);
|
||||
pe->SetHighlightCap(false);
|
||||
pe->SetFontType(Gfx::FONT_COURIER);
|
||||
pe->SetFontSize(6.5f);
|
||||
pe->ReadText("help/licences.txt");
|
||||
|
@ -1847,7 +1847,7 @@ ddim.y = 150.0f/480.0f;
|
|||
pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT1);
|
||||
pe->SetGenericMode(true);
|
||||
pe->SetEditCap(false);
|
||||
pe->SetHiliteCap(false);
|
||||
pe->SetHighlightCap(false);
|
||||
pe->SetFontType(Gfx::FONT_COURIER);
|
||||
pe->SetFontSize(8.0f);
|
||||
pe->ReadText("help/authors.txt");
|
||||
|
|
|
@ -990,13 +990,13 @@ void CStudio::UpdateButtons()
|
|||
{
|
||||
edit->SetIcon(1); // red background
|
||||
edit->SetEditCap(false); // just to see
|
||||
edit->SetHiliteCap(true);
|
||||
edit->SetHighlightCap(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
edit->SetIcon(0); // standard background
|
||||
edit->SetEditCap(true);
|
||||
edit->SetHiliteCap(true);
|
||||
edit->SetHighlightCap(true);
|
||||
}
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_COMPILE));
|
||||
|
@ -1525,7 +1525,7 @@ void CStudio::UpdateDialogList()
|
|||
for( fs::directory_iterator file(path); file != end_iter; file++) {
|
||||
if (fs::is_regular_file(file->status()) ) {
|
||||
TimeToAscii(fs::last_write_time(file->path()), time);
|
||||
sprintf(temp, "%s\t%lu \t%s", file->path().filename().c_str(), fs::file_size(file->path()), time);
|
||||
sprintf(temp, "%s\t%lu \t%s", file->path().filename().string().c_str(), fs::file_size(file->path()), time);
|
||||
|
||||
pl->SetName(i++, temp);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue