Skip to content

Instantly share code, notes, and snippets.

View fushnisoft's full-sized avatar

Brahn Partridge fushnisoft

View GitHub Profile
@fushnisoft
fushnisoft / CustomPanelControl.cs
Created June 11, 2014 19:31
Create custom controls for the Clarion IDE
using SoftVelocity.ClarionNet.CommonProperties;
using SoftVelocity.ClarionNet.Windows;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
namespace CustomPanelControl
{
[WindowDesignerClassAttribute, Designer(typeof(PanelControlDesigner), typeof(IDesigner)), ToolboxBitmap(typeof(MyPANEL), "PANEL.ico")]
public class MyPANEL : SoftVelocity.ClarionNet.Windows.PANEL
@fushnisoft
fushnisoft / VSDark.xml
Last active September 6, 2018 01:51
Make Clarion look a little bit like Visual studio. Install this clarion color scheme as "VSDark" and select it from Options-->IDE-->Appearance. Then, install the ClarionAddins SetTheme addin and apply the VSBlack theme from Options-->Clarion Addins-->Set IDE Theme.
<?xml version="1.0"?>
<AppearanceProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DockTabStripAppearance>
<xGradientBegin>-13816528</xGradientBegin>
<xGradientEnd>-13816528</xGradientEnd>
<xTextColor>ControlDark</xTextColor>
</DockTabStripAppearance>
<DockPadTitleAppearance>
<xActiveBackColorGradientBegin>-16745780</xActiveBackColorGradientBegin>
<xActiveBackColorGradientEnd>-16745780</xActiveBackColorGradientEnd>
@fushnisoft
fushnisoft / test.clw
Last active December 29, 2015 02:19
string ref test. Console output shows: c:\Dev\Console\>Console.exe thisString = hi there! null
PROGRAM
Include('ConsoleSupport.inc'),ONCE
Console ConsoleSupport
MAP
Main PROCEDURE()
MyTest PROCEDURE(<*STRING pString>)
END
CODE
@fushnisoft
fushnisoft / RefHandler.clw
Last active December 25, 2015 21:18
My fugly ref handler. I wanted to be able to have dynamic length strings stored in a clarion table (IMDD in particular). This is intended for a very specific situation and does not attempt to deal with threading, multiple tables, or any other fancy things but it appears to work well enough for my needs in this case! my_CStringClass could be anyt…
MEMBER()
INCLUDE('RefHandler.inc'),ONCE
MAP
END
RefHandler.Init PROCEDURE(*LONG pTheField)
CODE
IF pTheField = 0
! Create a new instance and assign the address to the storage field
@fushnisoft
fushnisoft / CwGet.md
Created October 7, 2013 14:47
Proposal for a Clarion package manager. Possible names: CWGe, CWPackageManager, CWPackage, ClarionGet ?

**Note: The idea for this is based on a combination of PsGet, http://psget.net/ and SublimeText Package Control, https://sublime.wbond.net/ **

  • Easy install via powershell

(new-object Net.WebClient).DownloadString("http://ClarionHub.com/GetCwGet.ps1") | iex

Proposed commands:

  • cwpackage-install
  • cwpackage-update
@fushnisoft
fushnisoft / cwprope.ps1
Created October 2, 2013 17:14
Use powershell to updated an attribute in ClarionPRoperties.xml
$doc = New-Object System.Xml.XmlDocument
$doc.Load("C:\Dev\Clarion\ClarionProperties.xml")
$XPath = "/ClarionProperties/Properties[@name='WorkbenchMemento']"
$node = ( $doc | Select-Xml -XPath $XPath ).Node
$node.bounds.value = "1,2,3,4"
$doc.Save("C:\Dev\Clarion\ClarionProperties.xml")
@fushnisoft
fushnisoft / ConsoleSupport.clw
Created September 19, 2013 15:05
Clarion console app!
Member()
Include('ConsoleSupport.inc'),ONCE
Map
MODULE('32-bit Windows API')
! General functions
GetLastError(),DWORD,PASCAL
! Console functions
GetStdHandle(DWORD),HANDLE,PASCAL,PROC,RAW
WriteConsole(Handle,Long,Dword,long,long),bool,Raw,Pascal,name('WriteConsoleA')
@fushnisoft
fushnisoft / GetJsonData.clw
Created September 15, 2013 19:31
Example of implementing a really, really basic DLLExport of Newtonsoft.Json reader and writer in Clarion. But it works pretty darn well! http://james.newtonking.com/projects/json/help/html/ReadingWritingJSON.htm
GetJsonData PROCEDURE(LONG pDate)
Json JsonClassType
CODE
Json.Init()
Json.InitWriter()
Json.WriteStartObject()
Json.WritePropertyName('key')
Json.WriteValue('ASDR-WERT-DFGG-RRTY')
@fushnisoft
fushnisoft / OcxIsRegistered.clw
Created August 29, 2013 17:01
OcxIsRegistered concept... NOTE: code not compiled or tested. I am mostly not sure if the second call to OleDirectory appends or replaces the contents of the QUEUE
OcxIsRegistered PROCEDURE(STRING pName) ! ,BYTE
resultQ QUEUE(oleQ)
END
CODE
OleDirectory(resultQ, 0, 3) ! <-- OLE Servers
OleDirectory(resultQ, 1, 3) ! <-- OLE Controls
Get(pResultQ, 0)
LOOP
Get(pResultQ, Pointer(pResultQ)+1)
IF ErrorCode()
$rtn = New-Object psobject -Property @{"Value"=$null; "name" = $null; "path"=$null}
1..500 |
ForEach-Object {
$rtn.Value = $_
$rtn.name = (new-object -com shell.application ).namespace($_).title
$rtn.path = (new-object -com shell.application ).namespace($_).self.path
if($rtn.name -ne $null)
{
Write-Host "$($rtn.value) $($rtn.name) $($rtn.path)"
}