1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// Copyright : (C) 2015 Eran Ifrah
// File name : clStatusBar.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifndef CLSTATUSBAR_H
#define CLSTATUSBAR_H
#include "clWorkspaceEvent.hpp"
#include "cl_command_event.h"
#include "codelite_exports.h"
#include "wxCustomStatusBar.h" // Base class: wxCustomStatusBar
#include <wx/bitmap.h>
class IManager;
class WXDLLIMPEXP_SDK clStatusBar : public wxCustomStatusBar
{
IManager* m_mgr;
wxBitmap m_bmpBuildError;
wxBitmap m_bmpBuildWarnings;
wxBitmap m_bmpSourceControl;
wxString m_sourceControlTabName;
wxStringMap_t m_gotoAnythingTableThemes;
wxStringMap_t m_gotoAnythingTableSyntax;
protected:
void OnPageChanged(wxCommandEvent& event);
void OnThemeChanged(wxCommandEvent& event);
void OnAllEditorsClosed(wxCommandEvent& event);
void OnBuildStarted(clBuildEvent& event);
void OnBuildEnded(clBuildEvent& event);
void OnWorkspaceClosed(clWorkspaceEvent& event);
void OnFieldClicked(clCommandEvent& event);
void OnEditorSettingsChanged(wxCommandEvent& event);
void OnGotoAnythingShowing(clGotoEvent& e);
void OnActionSelected(clGotoEvent& e);
void DoUpdateColour();
void DoSetLinePosColumn(const wxString& message);
void SetBuildBitmap(const wxBitmap& bmp, const wxString& tooltip);
void DoUpdateView();
void DoFieldClicked(int fieldIndex);
int GetTextWidth(const wxString& text) const;
public:
clStatusBar(wxWindow* parent, IManager* mgr);
virtual ~clStatusBar();
/**
* @brief clear all text fields from the status bar
*/
void Clear();
/**
* @brief set a status bar message
*/
void SetMessage(const wxString& message, int secondsToLive = wxNOT_FOUND);
/**
* @brief set the whitespace information (Tabs vs Spaces)
*/
void SetWhitespaceInfo();
/**
* @brief clear the whitespace info fields
*/
void ClearWhitespaceInfo();
/**
* @brief update the language field
*/
void SetLanguage(const wxString& lang);
/**
* @brief Update the encoding field
*/
void SetEncoding(const wxString& enc);
/**
* @brief update the line / column / pos field
*/
void SetLinePosColumn(const wxString& lineCol);
/**
* @brief start the animation
* @param refreshRate refresh rate in milliseconds
* @param tooltip set the tooltip for this field
*/
void StartAnimation(long refreshRate, const wxString& tooltip);
/**
* @brief stop the animation
*/
void StopAnimation();
/**
* @brief set a bitmap (16x16) in the source control section
* and optionally, provide an output tab name to toggle when the bitmap is clicked
*/
void SetSourceControlBitmap(const wxBitmap& bmp, const wxString& outputTabName, const wxString& tooltip);
};
#endif // CLSTATUSBAR_H
|