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 / EmbeddedDebugView.cs
Last active September 16, 2015 20:50
A quick and dirty way to attach "DebugView++.exe" to a window handle. The code makes a whole bunch of assumptions and has a lot of ugliness but it is so far serving my purpose so be nice :D
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace Fushnisoft.Utils
{
internal class EmbeddedDebugView
{
@fushnisoft
fushnisoft / CWBinding.Resources.Clarion-Mode.xshd
Created September 21, 2015 20:07
Clarion SyntaxDefinition - Dark!
<?xml version="1.0" encoding="utf-8"?>
<!--This file was autogenerated by the #Develop highlighting editor.-->
<SyntaxDefinition name="Clarion" extensions=".clw;.inc;.int;.trn;.equ">
<Environment>
<Custom name="Label" bold="false" italic="false" color="#a6e22e" />
<Custom name="OmittedCode" bold="false" italic="false" color="Black" bgcolor="#444444" />
<Custom name="GeneratedCode" bold="false" italic="false" color="Black" bgcolor="#444444" />
<Default bold="false" italic="false" color="#F8F8F2" bgcolor="#222222" />
<Selection bold="false" italic="false" color="White" bgcolor="#3399FF" />
<VRuler bold="false" italic="false" color="#E3E3E3" bgcolor="White" />
<?xml version="1.0" encoding="utf-8"?>
<!--This file was autogenerated by the #Develop highlighting editor.-->
<SyntaxDefinition name="Clarion" extensions=".clw;.inc;.int;.trn;.equ">
<Environment>
<Custom name="Label" bold="true" italic="false" color="Red" bgcolor="Blue" />
<Custom name="OmittedCode" bold="false" italic="false" color="Silver" bgcolor="Blue" />
<Custom name="GeneratedCode" bold="false" italic="false" color="Black" bgcolor="Blue" />
<Default bold="false" italic="false" color="Yellow" bgcolor="Blue" />
<Selection bold="false" italic="false" color="White" bgcolor="#3399FF" />
<VRuler bold="false" italic="false" color="#E3E3E3" bgcolor="White" />
@fushnisoft
fushnisoft / gist:2225570
Created March 28, 2012 11:43
Determine which monitor form is on (Clarion.Net)
(I assume that you have your own Rectagle fom the .Net window, I have created one here as a test)
thisScreen OF Screen = Screen.FromControl(SELF) ! <-- screen this form is currently on
! Get a Rectangle to use in our test below.
rect OF Rectangle = NEW Rectangle(thisScreen.Bounds.X, thisScreen.Bounds.Y, thisScreen.Bounds.Width, thisScreen.Bounds.Height)
! Loop through all known screens and test to see if our rectangle is on one of them
s OF Screen &= NULL ! Not sure if there is an "inline" way to do this in clarion...
FOREACH s IN Screen.AllScreens
IF s.Bounds.IntersectsWith(rect)
@fushnisoft
fushnisoft / gist:3276563
Created August 6, 2012 16:56
c# FromClarionColor (also now with ToClarionColor...)
// Update from skype discussion
// First, check to see if your input is a hex string or not
private static int GetClarionColorFromString(string line)
{
if (line.Contains("h") || line.Contains("H"))
{
char[] chars = { 'h', 'H' };
line = line.TrimEnd(chars);
@fushnisoft
fushnisoft / TestForRick.cs
Created August 11, 2012 18:29
Close app view and then delete the app file
using System;
using System.IO;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
using SoftVelocity.Generator.UI;
namespace ClarionAddins
{
public class TestForRick : AbstractMenuCommand
{
<AddIn name = "ClarionHub"
author = "ClarionHub"
copyright = ""
url = "http://ClarionHub.com"
description = "Simple example on how to add a button to the IDE toolbar that launches an EXE file">
<Manifest>
<Identity name = "MyToolbarButton" version="1.0"/>
</Manifest>
@fushnisoft
fushnisoft / gist:4753904
Created February 11, 2013 11:13
how to add an <All> or <Empty> item to a Clarion FileDrop
! Add the custom row in the reset method
FDBLocation.Reset PROCEDURE
CODE
! Add <All> entry to the queue
IF Records(SELF.Q) = 0
Clear(SELF.Q)
SELF.Q.PRE:DisplayFieldName = '<All>'
Add(SELF.Q)
END
@fushnisoft
fushnisoft / make_docs.ps1
Created February 15, 2013 16:01
Extract rst formatted documentation blocks from clarion inc/clw files and process using Sphinx
cls
if ($args[0])
{exit}
# NOTE: Make sure you have the PowerShell Community Extensions installed
# http://pscx.codeplex.com/
Import-Module pscx
function ProcessFile($pSourceFile, $pOutputFile) {
Write-Host "Processing" $pSourceFile