echo "***** Installing bbi on gnome desktop *****"
BBI=$(which bbi)
-echo "* bbi path = ${BBI}"
+BBED=$(which bbed)
+echo "* bbi path = ${BBI}"
+echo "* bbed path = ${BBED}"
TMP=$(which $0|rev)
TMP2=$(echo ${TMP#*/}|rev)
+ICONSPATH=${TMP2}/../@BBTK_DATA_REL_PATH@/kernel/icons
DATAPATH=${TMP2}/@bbtk_install_gnome_DATA_REL_PATH@
# The desktop launcher & its icon
ln -s ${HOME}/.local/share/applications/bbi.desktop ${HOME}/Desktop/bbi.desktop
-echo "* Copying bbi icons in ${HOME}/.local/share/applications/"
-cp ${DATAPATH}/bbi-icon.png ${HOME}/.local/share/applications/
-cp ${DATAPATH}/bbi-icon2.png ${HOME}/.local/share/applications/
+# The desktop launcher & its icon
+echo "* Creating bbed launcher on desktop (${HOME}/.local/share/applications/bbed.desktop)"
+sed s,HOME,${HOME},g ${DATAPATH}/bbed.desktop.in > bbtk_install_gnome_tmp
+sed s,BBED,${BBED},g bbtk_install_gnome_tmp > bbtk_install_gnome_tmp2
+mv bbtk_install_gnome_tmp2 ${HOME}/.local/share/applications/bbed.desktop
+rm bbtk_install_gnome_tmp
+
+ln -s ${HOME}/.local/share/applications/bbed.desktop ${HOME}/Desktop/bbed.desktop
+
+echo "* Copying icons in ${HOME}/.local/share/applications/"
+cp ${ICONSPATH}/*.png ${HOME}/.local/share/applications/
# add the type 'text/bbs' to mime database
echo "* Adding mime-type 'text/bbs' to mime database (${HOME}/.local/share/mime/packages/bbs.xml)"
Program: bbtk
Module: $RCSfile: bbtkWxEditor.cxx,v $
Language: C++
- Date: $Date: 2008/03/18 15:31:51 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/03/19 08:03:59 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void WxTextCtrlGettingKeyEvents::OnKeyUp(wxKeyEvent& event)
{
+ mWxEditor->OnKeyUp(event);
event.Skip();
}
void WxTextCtrlGettingKeyEvents::OnKeyDown(wxKeyEvent& event)
{
- mWxEditor->OnKeyPress(event);
+ mWxEditor->OnKeyDown(event);
event.Skip();
}
//================================================================
// sizer->AddGrowableCol(0);
// sizer->Add(mwxInputText,1,wxGROW);
- mwxInputText->SetFocus();
-
mwxOutputText =
new WxTextCtrlGettingKeyEvents(mwxSplit,
ID_OutputText,
btnsCtrlPanel->SetSizer(btnsSizer);
sizer->Add ( btnsCtrlPanel, 0, wxLEFT | wxRIGHT | wxBOTTOM //| wxGROW
, 10 );
-
+
// Redirection of std::cout and std::cerr to mwxOutputText and printf
- mRedirect_cout =
- new WxStreamRedirector(std::cout,mwxOutputText,*wxBLACK,true);
- mRedirect_cerr =
- new WxStreamRedirector(std::cerr,mwxOutputText,*wxGREEN,true);
-
-
- SetSizer(sizer);
+ mRedirect_cout =
+ new WxStreamRedirector(std::cout,mwxOutputText,*wxBLACK,true);
+ mRedirect_cerr =
+ new WxStreamRedirector(std::cerr,mwxOutputText,*wxGREEN,true);
+ UpdatePosition();
+ mwxInputText->SetFocus();
+
+ SetSizer(sizer);
SetAutoLayout(true);
Layout();
}
//================================================================
-
- //================================================================
+
+ //================================================================
WxEditor::~WxEditor()
{
delete mInterpreter;
//================================================================
- void WxEditor::OnButtonOpen(wxCommandEvent& event) { Open(); }
+ void WxEditor::OnButtonOpen(wxCommandEvent& event)
+ {
+ Open();
+ mwxInputText->SetFocus();
+ }
void WxEditor::Open()
{
std::cout << "-------------- OPEN ---------------"<<std::endl;
{
mwxInputText->LoadFile(std2wx(filename));
mwxInputText->SetModified(false);
+ UpdatePosition();
}
//================================================================
//================================================================
- void WxEditor::OnButtonSave(wxCommandEvent& event) { Save(); }
+ void WxEditor::OnButtonSave(wxCommandEvent& event)
+ {
+ Save();
+ mwxInputText->SetFocus();
+ }
void WxEditor::Save()
{
std::cout << "-------------- SAVE ---------------"<<std::endl;
//================================================================
//================================================================
- void WxEditor::OnButtonQuit(wxCommandEvent& event) { Quit(); }
+ void WxEditor::OnButtonQuit(wxCommandEvent& event)
+ {
+ Quit();
+ mwxInputText->SetFocus();
+ }
void WxEditor::Quit()
{
std::cout << "-------------- QUIT ---------------"<<std::endl;
//================================================================
- void WxEditor::OnButtonRun(wxCommandEvent& event) { Run(); }
+ void WxEditor::OnButtonRun(wxCommandEvent& event)
+ {
+ Run();
+ mwxInputText->SetFocus();
+ }
void WxEditor::Run()
{
std::cout << "-------------- RUN ---------------"<<std::endl;
//================================================================
//================================================================
- void WxEditor::OnButtonNew(wxCommandEvent& event) { New(); }
+ void WxEditor::OnButtonNew(wxCommandEvent& event)
+ {
+ New();
+ mwxInputText->SetFocus();
+ }
void WxEditor::New()
{
std::cout << "-------------- NEW ---------------" << std::endl;
AskSave();
mwxInputText->Clear();
+ UpdatePosition();
}
//================================================================
//================================================================
- void WxEditor::OnKeyPress(wxKeyEvent& event)
+ void WxEditor::UpdatePosition()
{
- long line, column, pos = mwxInputText->GetInsertionPoint();
- mwxInputText->PositionToXY(pos, &column, &line);
+ long line, column, pos;
+ pos = mwxInputText->GetInsertionPoint();
+ mwxInputText->PositionToXY(pos, &column, &line);
+
+
// wxLogMessage(_T("Current position: %ld\nCurrent line, column: (%ld, %ld)\nNumber of lines: %ld\nCurrent line length: %ld\nTotal text length: %u (%ld)"),
char mess[200];
- sprintf(mess,"%ld:%ld / %ld:%ld (%ld char)",
- line,column,
+ sprintf(mess,"%ld:%ld/%ld:%ld",
+ line+1,column+1,
(long)mwxInputText->GetNumberOfLines(),
- (long)mwxInputText->GetLineLength(line),
- (long)mwxInputText->GetValue().length());
+ (long)mwxInputText->GetLineLength(line)+1);
+ // pos+1,
+ // (long)mwxInputText->GetValue().length())+1;
mwxPosition->SetLabel(wxString(mess));
+ mwxPosition->Show();
+
+ }
+ //================================================================
+ //================================================================
+ void WxEditor::OnKeyUp(wxKeyEvent& event)
+ {
+ // std::cout << "U" << std::endl;
+ UpdatePosition();
+ }
+ //================================================================
+
+ //================================================================
+ void WxEditor::OnKeyDown(wxKeyEvent& event)
+ {
+ // std::cout << "D" << std::endl;
// std::cout << "Key="<<event.GetKeyCode()<<std::endl;
if ( event.ControlDown() )
{