Skip to main content

Dark theme in foxpro visual

Apply dark theme in visual foxpro editor and also in Notepad++

The editor will look very similar to the microsoft visual studio dark theme.

Requires Visual FoxPro 9 with SP2.

Colors used in the fonts:




FOXPRO LOOK 


*| AUTOCOM3 TECNOLOGIA E SOFTWARES LTDA (c) 2018 Todos os direitos reservados.
*|
*| Data da última revisão deste codigo: 02/10/2019 11:05:49 AM


SET PATH TO HOME() + "FFC\" ADDITIVE
#include "Registry.H"
CLEAR
setdarkthemeeditorcolors()
MESSAGEBOX([Volte a abrir o visual fox para aplicar o tema.];
, 4096 + 64;
, [DarkTheme for Microsoft Visual FoxPro])

FUNCTION setdarkthemeeditorcolors()
LOCAL lnloop    AS INTEGER;
, lcregkey  AS STRING;
, lcvalue   AS STRING;
, regconst  AS STRING
DIMENSION aeditorcolors[7, 3]
aeditorcolors[1, 1] = "EditorCommentColor"
aeditorcolors[1, 2] = "RGB(87,166,74,30,30,30), NoAuto, NoAuto"
aeditorcolors[2, 1] = "EditorKeywordColor"
aeditorcolors[2, 2] = "RGB(57,135,214,30,30,30), NoAuto, NoAuto"
aeditorcolors[3, 1] = "EditorConstantColor"
aeditorcolors[3, 2] = "RGB(177,130,177,30,30,30), NoAuto, NoAuto"
aeditorcolors[4, 1] = "EditorNormalColor"
aeditorcolors[4, 2] = "RGB(0,255,0,30,30,30), NoAuto, NoAuto"
aeditorcolors[5, 1] = "EditorOperatorColor"
aeditorcolors[5, 2] = "RGB(220,220,220,30,30,30), NoAuto, NoAuto"
aeditorcolors[6, 1] = "EditorStringColor"
aeditorcolors[6, 2] = "RGB(214,136,82,30,30,30), NoAuto, NoAuto"
aeditorcolors[7, 1] = "EditorVariableColor"
aeditorcolors[7, 2] = "RGB(127,216,170,30,30,30), NoAuto, NoAuto"
lcregkey = "Software\Microsoft\VisualFoxPro\9.0\Options"
regconst = HKEY_CURRENT_USER

FOR lnloop = 1 TO ALEN(aeditorcolors, 1)
lcvalue = setregkey(regconst, lcregkey, aeditorcolors[lnLoop, 1], aeditorcolors[lnLoop, 2])
ENDFOR
*
ENDFUNC


FUNCTION setregkey()
LPARAMETERS hkey AS CHARACTER, keypath AS CHARACTER, entry AS CHARACTER, regvalue AS CHARACTER
getregistryapi()
keypath = ADDBS(TRANSFORM(EVL(keypath, "")))
entry = TRANSFORM(EVL(entry, ""))
regvalue = TRANSFORM(regvalue)
RETURN (oregapi.setregkey(entry, regvalue, keypath, hkey, .T.) = 0)

FUNCTION getregistryapi() AS registry

IF VARTYPE(oregapi) # "O"
PUBLIC oregapi AS registry
oregapi = NEWOBJECT("Registry",;
HOME() + "FFC\Registry.VCX")
ENDIF

RETURN oregapi
ENDFUNC




*| Fim

NOTEPAD++ 

Theme download link for notepad++


RESULTS 

In visual foxpro the editor will look like this:




In notepad++ the editor will look like this:









Comments

Most visited posts

How to change color according to cell value in Visual Foxpro grid.

This post teaches you how to get the effect shown in the image below using the GRID component of visual fox pro. Requires visual foxpro 9.0 SP2 I usually create a class for this, but here in the example I will do it in the simplest way, however, using a method inside the form. You need to create a blank form, add a GRID, a REFRESH button and add a table.  In my example I used a very basic table, called VALORES.DBF, with the VALOR field.  If the value is 1, I use one color, if it is 2, I use another and so on. My VALORES.DBF table is in the same directory where I am saving the FORM.  Creating the table CREATE TABLE values ​​(n(10,2) value) INSERT INTO values ​​(value) VALUES (1) INSERT INTO values ​​(value) VALUES (2) INSERT INTO values ​​(value) VALUES (3)  FORM PROPERTIES BINDCONTROLS = .F. DATASESSION = 1  INIT SELECT values LOCATE THISFORM.BINDCONTROLS = .T.  LOAD METHOD IF NOT FILE('values.dbf') SET MESSAGE TO MESSAGEBOX('Table VALORES.DBF is not...

How to deploy a printed pages control in the VFP to take an action after the report prints.

Isolved this issue by creating a public variable: PUBLIC _npagetotal _npagetotal = 0 Then, using the ReportListener component to control the reports, analyze the pagetotal property after the report runs.  If it returns <> 0, it means there was content in the report and if it returns 0 (zero), there was no content. */ control of printed pages _npagetotal = 0 LOCAL loreportlistener loreportlistener = CREATEOBJECT("ReportListener") loreportlistener.LISTENERTYPE = 0 loreportlistener.QUIETMODE = .T. REPORT FORM pathgeral + '\report\danfe_nfce_2.frx' OBJECT loreportlistener        _npagetotal = loreportlistener.pagetotal RELEASE loreportlistener IF _npagetotal<> 0 THEN   * PERFORMS AN ENDIF  ACTION