-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d178c25
commit c6b9b10
Showing
701 changed files
with
3,501 additions
and
1,453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
set(FOX_LIBRARIES fox) | ||
set(FOX_INCLUDE_DIRS $<TARGET_PROPERTY:fox,INTERFACE_INCLUDE_DIRECTORIES>) | ||
|
||
set(TARGET_NAME ControlPanel) | ||
set(SOURCES ControlPanel.cpp icons.cpp) | ||
set(HEADERS ControlPanel.h icons.h) | ||
|
||
set(ICONS controlpanel_gif.gif | ||
colors_gif.gif | ||
filebinding_gif.gif | ||
settings_gif.gif) | ||
|
||
add_custom_command( | ||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/icons.cpp ${CMAKE_CURRENT_SOURCE_DIR}/icons.h | ||
COMMAND reswrap -h -o icons.h ${ICONS} | ||
COMMAND reswrap -i icons.h -o icons.cpp ${ICONS} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
DEPENDS reswrap | ||
VERBATIM | ||
) | ||
|
||
add_executable(${TARGET_NAME} ${SOURCES} ${HEADERS}) | ||
target_include_directories(${TARGET_NAME} PRIVATE ${FOX_INCLUDE_DIRS}) | ||
target_link_libraries(${TARGET_NAME} PUBLIC fox) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.TH ControlPanel 1 "April 2021" | ||
.SH NAME | ||
ControlPanel \- Configure desktop settings for FOX Toolkit applications | ||
.SH SYNOPSIS | ||
\fBControlPanel\fP | ||
.SH DESCRIPTION | ||
.LP | ||
The ControlPanel allows the user to change the color themes, fonts, and file bindings of | ||
FOX Toolkit based programs. | ||
|
||
.SH USAGE | ||
.LP | ||
The ControlPanel has three tabs: \fBThemes\fP, \fBBindings\fP, and \fBGeneral\fP. | ||
|
||
.br | ||
The Themes tab is used to control color themes, individual colors, and the system | ||
font. | ||
|
||
.br | ||
The Bindings tab is used to associate file extension-associations with a description, | ||
command, and mime-type. The user can also assign icons. | ||
|
||
.br | ||
The General tab is used to control some common parameters of FOX Toolkit programs, such as | ||
tooltip delay, mouse wheel speed, and so on. | ||
|
||
.SH AUTHOR | ||
This man page was written by Jeroen van der Zijp <jeroen@fox-toolkit.com>. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,247 @@ | ||
/******************************************************************************** | ||
* * | ||
* FOX Desktop Setup - FOX Desktop Enviroment * | ||
* * | ||
********************************************************************************* | ||
* Copyright (C) 2004,2021 Sander Jansen. All Rights Reserved. * | ||
********************************************************************************* | ||
* This library is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU Lesser General Public License as published by * | ||
* the Free Software Foundation; either version 3 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This library is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU Lesser General Public License for more details. * | ||
* * | ||
* You should have received a copy of the GNU Lesser General Public License * | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> * | ||
********************************************************************************/ | ||
#ifndef CONTROLPANEL_H | ||
#define CONTROLPANEL_H | ||
|
||
|
||
// Color theme info | ||
struct ColorTheme { | ||
const FXchar* name; | ||
FXColor base; | ||
FXColor border; | ||
FXColor back; | ||
FXColor fore; | ||
FXColor selback; | ||
FXColor selfore; | ||
FXColor tipback; | ||
FXColor tipfore; | ||
FXColor menuback; | ||
FXColor menufore; | ||
}; | ||
|
||
|
||
// Up to 4 icons associated with file | ||
enum { | ||
BIG_ICON, | ||
BIG_ICON_OPEN, | ||
MINI_ICON, | ||
MINI_ICON_OPEN | ||
}; | ||
|
||
|
||
// File binding | ||
struct FXFileBinding { | ||
FXString key; // Registry key | ||
FXString description; // Description | ||
FXString command; // Command to invoke | ||
FXString iconfile[4]; // Icon file names | ||
FXString mime; // Mime type | ||
FXuint flags; // Flags | ||
}; | ||
|
||
|
||
// Control panel widget | ||
class FXDesktopSetup : public FXMainWindow { | ||
FXDECLARE(FXDesktopSetup) | ||
private: | ||
FXSettings desktopsettings; // Desktop Settings Registry | ||
FXFont *titlefont; | ||
FXIcon *desktopicon; | ||
FXIcon *icon_colors; | ||
FXIcon *icon_settings; | ||
FXIcon *icon_filebinding; | ||
private: | ||
FXListBox *list; | ||
FXList *filebindinglist; | ||
FXComboBox *mimetypelist; | ||
FXButton *iconbutton[4]; | ||
FXIcon *iconimage[4]; | ||
FXLabel *vendorandapplication; | ||
private: | ||
FXToolTip *tooltip; | ||
FXTabBook *tabbook; | ||
FXTabItem *tabitem; | ||
FXVerticalFrame *tabframe; | ||
FXVerticalFrame *mainframe; | ||
FXVerticalFrame *menuframe; | ||
FXHorizontalFrame *labeltextframe1; | ||
FXHorizontalFrame *labeltextframe2; | ||
FXHorizontalFrame *textframe1; | ||
FXHorizontalFrame *textframe2; | ||
FXHorizontalFrame *tabsubframe; | ||
FXGroupBox *grpbox1; | ||
FXGroupBox *grpbox2; | ||
FXLabel *label1; | ||
FXLabel *label2; | ||
FXLabel *label3; | ||
FXLabel *label4; | ||
FXLabel *label5; | ||
FXLabel *menulabels[6]; | ||
FXTextField *textfield1; | ||
FXButton *button1; | ||
FXButton *fontbutton; | ||
FXSeparator *sep1; | ||
FXSeparator *sep2; | ||
FXSeparator *sep3; | ||
private: | ||
ColorTheme theme_current; // Current Settings | ||
ColorTheme theme_user; // Theme User may have set, which is different from the other themes | ||
private: | ||
FXFont *font; | ||
FXbool hascurrent; | ||
FXString fontspec; // Selected font | ||
FXString filename; // Filename of settings file | ||
FXString applicationname; // If editing specific application settings | ||
FXString vendorname; // If editing specific vendor settings | ||
FXString iconpath; // Path where icons are found | ||
FXTime typingSpeed; | ||
FXTime clickSpeed; | ||
FXTime scrollSpeed; | ||
FXTime scrollDelay; | ||
FXTime blinkSpeed; | ||
FXTime animSpeed; | ||
FXTime menuPause; | ||
FXTime tooltipPause; | ||
FXTime tooltipTime; | ||
FXuint maxcolors; | ||
FXint dragDelta; | ||
FXint wheelLines; | ||
FXint barSize; | ||
FXfloat gamma; | ||
FXFileBinding filebinding; // Current file binding | ||
private: | ||
FXDataTarget target_base; // Color targets | ||
FXDataTarget target_back; | ||
FXDataTarget target_border; | ||
FXDataTarget target_fore; | ||
FXDataTarget target_selfore; | ||
FXDataTarget target_selback; | ||
FXDataTarget target_tipfore; | ||
FXDataTarget target_tipback; | ||
FXDataTarget target_menufore; | ||
FXDataTarget target_menuback; | ||
FXDataTarget target_typingspeed; // Time targets | ||
FXDataTarget target_clickspeed; | ||
FXDataTarget target_scrollspeed; | ||
FXDataTarget target_scrolldelay; | ||
FXDataTarget target_blinkspeed; | ||
FXDataTarget target_animspeed; | ||
FXDataTarget target_menupause; | ||
FXDataTarget target_tooltippause; | ||
FXDataTarget target_tooltiptime; | ||
FXDataTarget target_dragdelta; // Move mouse delta | ||
FXDataTarget target_wheellines; // Mouse wheel lines | ||
FXDataTarget target_barsize; // Scroll bar size | ||
FXDataTarget target_maxcolors; // Maximum colors | ||
FXDataTarget target_gamma; // Display gamma value | ||
FXDataTarget target_filebinding_description; | ||
FXDataTarget target_filebinding_command; | ||
FXDataTarget target_iconpath; | ||
private: | ||
void setupFont(); | ||
void initColors(); | ||
void setupColors(); | ||
void saveFileBinding(); | ||
void setupFileBindings(); | ||
void setupVendorAndAppLabel(); | ||
void setupIconButton(const FXString& name,FXint index); | ||
FXIcon *createIconFromName(const FXString& name) const; | ||
private: | ||
FXDesktopSetup(){} | ||
FXDesktopSetup(const FXDesktopSetup&); | ||
FXDesktopSetup& operator=(const FXDesktopSetup&); | ||
public: | ||
enum { | ||
ID_COLORS=FXMainWindow::ID_LAST, | ||
ID_COLOR_THEME, | ||
ID_CHOOSE_FONT, | ||
ID_SELECT_COMMAND, | ||
ID_CREATE_FILEBINDING, | ||
ID_REMOVE_FILEBINDING, | ||
ID_RENAME_FILEBINDING, | ||
ID_SELECT_FILEBINDING, | ||
ID_SELECT_ICON_BIG, | ||
ID_SELECT_ICON_BIGOPEN, | ||
ID_SELECT_ICON_MINI, | ||
ID_SELECT_ICON_MINIOPEN, | ||
ID_SELECT_MIMETYPE, | ||
ID_RUN_IN_TERMINAL, | ||
ID_CHANGE_DIRECTORY | ||
}; | ||
public: | ||
long onColorChanged(FXObject*,FXSelector,void*); | ||
long onColorTheme(FXObject*,FXSelector,void*); | ||
long onChooseFont(FXObject*,FXSelector,void*); | ||
long onCmdFileBinding(FXObject*,FXSelector,void*); | ||
long onCmdMimeType(FXObject*,FXSelector,void*); | ||
long onCmdCreateFileBinding(FXObject*,FXSelector,void*); | ||
long onCmdRemoveFileBinding(FXObject*,FXSelector,void*); | ||
long onCmdRenameFileBinding(FXObject*,FXSelector,void*); | ||
long onCmdSelectCommand(FXObject*,FXSelector,void*); | ||
long onCmdSelectIcon(FXObject*,FXSelector,void*); | ||
long onUpdRunInTerminal(FXObject*,FXSelector,void*); | ||
long onCmdRunInTerminal(FXObject*,FXSelector,void*); | ||
long onUpdChangeDirectory(FXObject*,FXSelector,void*); | ||
long onCmdChangeDirectory(FXObject*,FXSelector,void*); | ||
public: | ||
|
||
// Constructor | ||
FXDesktopSetup(FXApp *app); | ||
|
||
// Set filename | ||
void setFilename(const FXString& file){ filename=file; } | ||
|
||
// Return filename | ||
FXString getFilename() const { return filename; } | ||
|
||
// Change application name | ||
void setApplicationName(const FXString& name){ applicationname=name; } | ||
|
||
// Return application name | ||
const FXString& getApplicationName() const { return applicationname; } | ||
|
||
// Change vendor name | ||
void setVendorName(const FXString& name){ vendorname=name; } | ||
|
||
// Return vendor name | ||
const FXString& getVendorName() const { return vendorname; } | ||
|
||
// Set filename from vendor and application name | ||
FXbool setApplicationAndVendor(const FXString& an,const FXString& vn=FXString::null); | ||
|
||
// Create widgets | ||
virtual void create(); | ||
|
||
// Read settings file | ||
FXbool readSettingsFile(const FXString& file); | ||
|
||
// Write settings file | ||
FXbool writeSettingsFile(const FXString& file); | ||
|
||
// Close the application, return TRUE if actually closed | ||
virtual FXbool close(FXbool notify=false); | ||
|
||
// Destructor | ||
virtual ~FXDesktopSetup(); | ||
}; | ||
|
||
|
||
#endif |
Oops, something went wrong.