Mini Kabibi Habibi

Current Path : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/tools/hexedit/
Upload File :
Current File : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/tools/hexedit/hexedit.vct

R�VERSION =  0.029!Arial, 0, 9, 5, 15, 12, 21, 3, 0
refusefocusPixelsIIf user attempts to give column focus, focus is moved to adjacent column.Class1textboxrefusefocus�� ��V/%1�#C6U�T���������������
H�0���������%�������T���a�������%�C�HEXEDITO�����
H���������	�T���-��������
��������l�%�����U�#%�C�HEXEDITOC�HEXEDITN
��>�T���a�����
��H����	�T���-���Q��������h�������2�����
�����UNCOLNUMTHISFORMSETTHISPARENTACTIVECOLUMNTHISFORM
LOCKSCREENCOLUMN17SETFOCUSREFRESHCOLUMN2HEXEDITGotFocus,��12�!����A����A!1�������A��A��AB3�)��PROCEDURE GotFocus
** This object never allows focus.  Must decide where to set focus, then set it.
** If focus is coming from the last hex column, move focus to the first column
** of the next row, for convenience when editing.

nColNum = THISFORMSET.nColNum	&& THISFORMSET.nColNum is set in the grid's BeforeRowColChange event.

WITH THIS.PARENT.PARENT		&& The grid.
DO CASE
CASE .ActiveColumn = 1
	IF nColNum = 2	&& Focus came from the first hex column
		* Must make sure no keystrokes are accepted between the
		* SETFOCUS and the SKIP commands below.
		THISFORM.LOCKSCREEN = .T.
		.Column17.SETFOCUS
		* IF we were here, we're moving backward.
		IF RECNO("HEXEDIT") > 1
			SKIP -1
		ENDIF
		.REFRESH	&& Necessary, or keystrokes can go in wrong cell.
		THISFORM.LOCKSCREEN = .F.
	ELSE
		&& Clicked from somewhere else, or got focus by prg.
		.Column2.SETFOCUS
	ENDIF
CASE .ActiveColumn = 18
		IF nColNum = 17	&& Focus came from last Hex column, we must be moving forward
			IF RECNO("HEXEDIT") < RECCOUNT("HEXEDIT")
				* Must make sure no keystrokes are accepted between the
				* SETFOCUS and the SKIP commands below.
				THISFORM.LOCKSCREEN = .T.
				.Column2.SETFOCUS
				SKIP IN HEXEDIT
				.REFRESH
				THISFORM.LOCKSCREEN = .F.
			ELSE
				.Column17.SETFOCUS
			ENDIF
		ELSE
			.Column17.SETFOCUS
		ENDIF
OTHERWISE
		*  Haven't entered a hex column yet.
		.Column2.SETFOCUS
ENDCASE

ENDWITH


ENDPROC
IHeight = 23
Width = 100
ForeColor = 255,255,255
Name = "refusefocus"
textbox"Courier, 0, 9, 9, 16, 13, 9, 3, 0
text1Pixels-Text1 object for Hex editing portion of grid.Class1textboxtext1hexisvalid
T�� ;;ά%	�EH6U~
�����w�%�C���>���T�T��C�����T��C���������s���C�	BackColor������UTHISPARENTDYNAMICBACKCOLOR	BACKCOLORDISABLEDBACKCOLORREFRESHRESETTODEFAULTX����
H��M�3�C��0�9��C��a�f��C��A�F���O�B������d�B��������
�����
�����
��C�����������
�����
�����
��C����������
�����
�����
��C���������D�
���	��
���	��
��C�������������%��
���
������
������
��������V����%��
���
������
������
���������������<�C�����C�����	����	�����7�B�2�M���C� �����UNKEYCODE
NSHIFTALTCTRLTHISFORMCMDPREVIOUSSECTORSETFOCUSCLICKTHIS
CMDNEXTSECTORCMDTOPOFFILECMDBOTTOMOFFILETHISFORMSET	HEXEDITORCMDFINDNEXTENABLEDCMDFINDPREVIOUST���a���������%��-��t�%���-��p�T���a��T����a��T��	��a����T�
�C������T�
�����T�������7T�
�C�
��=C�
 C��
�C�
�\��6��>����
����������T���-��UTHISFORM
LOCKSCREENTHISPARENTREADONLYTHISFORMSETLSECTORDIRTYCMDSAVEEDITSENABLEDCMDREVERTEDITS
NASCIICODEHEX2DECVALUE	CTEMPTEXTHEXEDITTEXTNCOLNUMACTIVECOLUMNCOLUMN18REFRESHGotFocus,��KeyPress��InteractiveChange��1�qAC��rAA3��2AA������������!aAaA��A��AC2�!�AArq�A�1�p	3�	
C);
'PROCEDURE GotFocus
*  Make textbox backcolor match the dynamic backcolor (if part of "found" string) of
*  its cell in the grid.
WITH THIS
IF LEN(.PARENT.DynamicBackColor) > 0
	.Backcolor = EVALUATE(.PARENT.DynamicBackcolor)
	*  If file is opened read-only, all the textboxes are disabled.
	*  So must set the DisabledBackcolor also.
	.DisabledBackcolor = EVALUATE(.PARENT.DynamicBackcolor)
	.Refresh
ELSE
	*  Set back to correct color.
	.ResetToDefault("BackColor")
ENDIF
ENDWITH

ENDPROC
PROCEDURE KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl

**  Must be numeric or in "ABCDEF" or arrow keys or bkspace.
DO CASE
	* Put valid keystrokes first
	CASE BETWEEN(nKeyCode, 48, 57) OR BETWEEN(nKeyCode, 97, 102) OR BETWEEN(nKeyCode, 65, 70)
		RETURN	&& Valid character keystroke.  Exit immediately.
	CASE nShiftAltCtrl >= 4 	&& if alt held down.
		RETURN	&& no special handling
	CASE nKeyCode = 31	&& Ctrl + PgUp
		THISFORM.cmdPreviousSector.SetFocus	&& Need to get focus out of grid.
		THISFORM.cmdPreviousSector.CLICK
		THIS.SetFocus()
	CASE nKeyCode = 30	&& Ctrl + PgDn
		THISFORM.cmdNextSector.SetFocus	&& Need to get focus out of grid.
		THISFORM.cmdNextSector.CLICK
		THIS.SetFocus()
	CASE nKeyCode = 29	&& Ctrl + Home
		THISFORM.cmdTopOfFile.SetFocus	&& Need to get focus out of grid.
		THISFORM.cmdTopOfFile.CLICK
		THIS.SetFocus()
	CASE nKeyCode = 23	&& Ctrl + End
		THISFORM.cmdBottomOfFile.SetFocus	&& Need to get focus out of grid.
		THISFORM.cmdBottomOfFile.CLICK
		THIS.SetFocus()
	CASE nKeycode = -2	&&nKeyCode = 145 AND nShiftAltCtrl = 2	&& Ctrl+DnArrow
		IF THISFORMSET.HexEditor.cmdFindNext.Enabled
			THISFORMSET.HexEditor.cmdFindNext.SetFocus
			THISFORMSET.HexEditor.cmdFindNext.Click
		ENDIF
	CASE nKeyCode = 86	&&nKeyCode = 141 AND nShiftAltCtrl = 2	&& Ctrl+UpArrow
		IF THISFORMSET.HexEditor.cmdFindPrevious.Enabled
			THISFORMSET.HexEditor.cmdFindPrevious.SetFocus
			THISFORMSET.HexEditor.cmdFindPrevious.Click
		ENDIF

	CASE nKeyCode = 7 OR nKeyCode = 127
		** Do nothing.  Will hit the NODEFAULT after the DO CASE structure.
	CASE BETWEEN(nKeyCode, 0, 25) OR BETWEEN(nKeyCode ,25,31);
		OR (nKeyCode = 148) OR (nKeyCode = 165)	&& All valid keystrokes not already dealt with.
		RETURN
	OTHERWISE
		?? CHR(7)		
ENDCASE

** If we are here, the keystroke needed special handling, and should not be passed on to the textbox.
NODEFAULT
ENDPROC
PROCEDURE InteractiveChange
*  If we've entered this event, the KeyPress event has already decided
*  that it is a valid keystroke (0-9 or A-F)
THISFORM.Lockscreen = .T.

WITH THIS.PARENT
IF .READONLY = .F.	&& If editing is enabled.
	IF THISFORMSET.lSectorDirty = .F.			&& If flag not already set
		THISFORMSET.lSectorDirty = .T.			&& Set flag that this sector has been modified.
		THISFORM.cmdSaveEdits.ENABLED = .T.		&& Enable save/undo buttons.
		THISFORM.cmdRevertEdits.Enabled = .T.
	ENDIF
ENDIF

nAsciiCode = THISFORMSET.Hex2Dec(THIS.VALUE)

** Update the Text column.
cTempText = HEXEDIT.Text		&& Get current string from table.
nColNum = .PARENT.ActiveColumn
cTempText = LEFT(cTempText, nColNum - 2) + CHR(nAsciiCode) + IIF(nColNum < 17, SUBST(cTempText, nColNum), "")
REPLACE HEXEDIT.Text WITH cTempText
.PARENT.COLUMN18.REFRESH		&& Only refresh the Text column.
ENDWITH

THISFORM.LockScreen = .F.
ENDPROC
�FontBold = .F.
FontName = "Courier"
FontSize = 9
BorderStyle = 0
Format = "!!"
Height = 25
InputMask = ""
Margin = 0
SpecialEffect = 1
Width = 28
hexisvalid = .T.
Name = "text1"
textbox!Arial, 0, 9, 5, 15, 12, 21, 3, 0

txtfindstringPixels0Textbox object for Decimal grid in FindStr form.Class1textbox
txtfindstring�� ��J%yVO�6U�T���������.%����CCC��������Z	����T��	�a����
���(�����������$%�CCC�
�������Z
����!����%��
������������
����
����
��T��	�-���UNPREVIOUSCOLUMNTHISPARENTACTIVECOLUMNTHISFORMGRDHEXCOLUMNSTEXT1VALUE
LOCKSCREENNCURRENTCOLSETFOCUSGRDCHARREFRESHT��������T��CC������+>��FindStrH��C��FindStrH/�����
���	���T��
�������������
�����
�S%�CC�	FindStrH.C��FindStrH/��
�$CC�	FindStrH.C��FindStrH/��Z
	����T����a����T����-�����UNCURRENTCOLTHISPARENTACTIVECOLUMN	CTEMPTEXTTHISFORMSETDEC2HEXVALUEINTHISFORMGRDHEXCOLUMNSTEXT1REFRESHCMDFINDENABLEDT����
H��M�$�C���~��C��������@�B������n�����������������������������������
������
�����������������T�	�����
��%��	�
��o�%%�CC�	������
�Z
��k�%��	����	��c��������	�����B���T��
����$T���	FindStr.CCC�	��Z���>�������T�����	���
����%T���
FindStrH.CCC�	��Z���>�������%��	����	��D��������	�������S%�CC�	FindStrH.C��FindStrH/��
�$CC�	FindStrH.C��FindStrH/��Z
	����T����a�����T����-����
�������	��+���T���a�����������
���T���-�������M���
������UNKEYCODE
NSHIFTALTCTRLTHISPARENTCOLUMNSSETFOCUSTHISFORMCMDFINDCLICK
NACTIVECOLUMNACTIVECOLUMNGRDHEXTEXT1VALUE
CFIELDNAMEENABLEDREFRESH
LOCKSCREEN	CMDCANCELGotFocus,��InteractiveChange���KeyPresse��1����AAAA��A�A2c����A4���AA4��AAA�A�A��AaQ��AAAAA�Q���3�AA�C���A�A2��Sr]
+)�
hPROCEDURE GotFocus
** To make grid act more like textbox, make focus move to cell just after last
** non-blank cell if user clicks to the right of non-blank cells
nPreviousColumn = THIS.PARENT.PARENT.ActiveColumn - 1
IF nPreviousColumn > 0 AND ISBLANK(ALLTRIM(THISFORM.grdHex.COLUMNS(nPreviousColumn).Text1.VALUE))
	THISFORM.LOCKSCREEN = .T.
	FOR nCurrentCol = nPreviousColumn to 1 STEP -1
		IF !ISBLANK(ALLTRIM(THISFORM.grdHex.COLUMNS(nCurrentCol).Text1.VALUE))
			EXIT
		ENDIF
	NEXT
	IF nCurrentCol != nPreviousColumn		&& Did we have to move?
		THIS.PARENT.PARENT.COLUMNS(nCurrentCol + 1).SETFOCUS
		THISFORM.grdChar.REFRESH
	ENDIF

	THISFORM.LOCKSCREEN = .F.
ENDIF
ENDPROC
PROCEDURE InteractiveChange
** Current cell has been edited.  Translate, and update the Hex grid.

nCurrentCol = THIS.PARENT.PARENT.ActiveColumn
cTempText = THISFORMSET.DEC2HEX(ASC(THIS.VALUE))
REPLACE (FIELD(nCurrentCol, "FindStrH")) WITH cTempText IN "FindStrH"

WITH THISFORM
	*  Update the Hex grid.
	.grdHex.Columns(nCurrentCol).Text1.Value = cTempText
	.grdHex.Columns(nCurrentCol).REFRESH
	
	*  If there is something to search for, enable the Find button.
	IF !ISNULL(EVAL("FindStrH." + FIELD(1,"FindStrH"))) ;
		AND !ISBLANK(EVAL("FindStrH." + FIELD(1, "FindStrH")))
		.cmdFind.Enabled = .T.
	ELSE
		.cmdFind.Enabled = .F.
	ENDIF
ENDWITH


ENDPROC
PROCEDURE KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl

** Handle certain keystrokes, to make grid act more like a textbox.
DO CASE
CASE BETWEEN(nKeyCode, 16, 126) OR BETWEEN(nKeyCode,129,255)
	RETURN	&& Return immediately if typical keystroke.
CASE nKeyCode = 1	&& Home
	NODEFAULT
	THIS.PARENT.PARENT.Columns(1).SETFOCUS
CASE nKeyCode = 6	&& End
	NODEFAULT
	THIS.PARENT.PARENT.Columns(15).SETFOCUS
CASE nKeyCode = 13	&& Return
	NODEFAULT
	THISFORM.cmdFind.Click
CASE nKeyCode = 127	OR nKeyCode = 7	&& Backspace
	NODEFAULT
	nActiveColumn = THIS.PARENT.PARENT.ActiveColumn
	IF nActiveColumn < 15
		IF !ISBLANK(THISFORM.grdHex.Columns(nActiveColumn + 1).Text1.Value)
			** Cell to right isn't blank.  Just move pointer.
			IF nActiveColumn > 1 AND nKeyCode = 127
				THIS.PARENT.PARENT.Columns(nActiveColumn - 1).SETFOCUS
			ENDIF
			RETURN
		ENDIF
	ENDIF
	** If we made it here, we can delete and move freely.
	THIS.VALUE = ""			&& since we issue NODEFAULT, the value is not stored as we lose focus.
	cFieldName = "FindStr.C" + ALLTRIM(STR(nActiveColumn,2,0))
	REPLACE (cFieldName) WITH ""		&& Do it manually.
	THISFORM.grdHex.Columns(nActiveColumn).Text1.Value = ""
	cFieldName = "FindStrH.C" + ALLTRIM(STR(nActiveColumn,2,0))
	REPLACE (cFieldName) WITH ""
	IF nActiveColumn > 1 AND nKeyCode = 127
		THIS.PARENT.PARENT.Columns(nActiveColumn - 1).SETFOCUS
	ELSE
		*  If there is nothing to search for, disable the Find button.
		IF !ISNULL(EVAL("FindStrH." + FIELD(1,"FindStrH"))) ;
			AND !ISBLANK(EVAL("FindStrH." + FIELD(1, "FindStrH")))
			THISFORM.cmdFind.Enabled = .T.
		ELSE
			THISFORM.cmdFind.Enabled = .F.
		ENDIF
	ENDIF
	THISFORM.REFRESH
CASE nKeyCode = 9 		&& Tab
	** Default for the grid is to move to next field in grid.  Needs to move focus to
	** next control.
	NODEFAULT
	THISFORM.Lockscreen = .T.
	THISFORM.grdHex.Columns(This.parent.parent.ActiveColumn).SETFOCUS
	THISFORM.Lockscreen = .F.
CASE nKeyCode = 15		&& ShiftTab.
	NODEFAULT
	THISFORM.cmdCancel.SETFOCUS
ENDCASE

ENDPROC
sBorderStyle = 0
Height = 21
InputMask = "X"
Margin = 0
SpecialEffect = 1
Width = 100
Name = "txtfindstring"
textbox"Courier, 0, 8, 9, 16, 13, 9, 3, 0
txtfindstringhexPixels,Textbox object for Hex grid in FindStr form.Class1textboxtxtfindstringhex	^�� E	E	�%��X,6U�����
H����$�C���~��C����������+%�C� �1234567890abcdefABCDEF
��y���C� �����B������������������������������������������
������
����������������T�	�����
��%��	�
����(%�CC�	��������Z
����%��	����	�����������	�����B���T������$T�
��	FindStr.CCC�	��Z���>��
�����T�����	�������%T�
��
FindStrH.CCC�	��Z���>��
�����%��	����	�����������	������S%�CC�	FindStrH.C��FindStrH/��
�$CC�	FindStrH.C��FindStrH/��Z
	����T����a���
�T����-����
�������	��D������������������T���a�����������
���T���-���UNKEYCODE
NSHIFTALTCTRLTHISPARENTCOLUMNSSETFOCUSTHISFORMCMDFINDCLICK
NACTIVECOLUMNACTIVECOLUMNTEXT1VALUE
CFIELDNAMEGRDHEXENABLEDREFRESHOPTSEARCHDIRECTIONOPTION1
LOCKSCREENGRDCHAR����������T������)%����CCC�������Z	����T���a����	���(�����������%�CCC�	������Z
����!����%��	����������	���
�����T���-�����UTHISPARENTNPREVIOUSCOLUMNACTIVECOLUMNCOLUMNSTEXT1VALUETHISFORM
LOCKSCREENNCURRENTCOLSETFOCUSREFRESHMT��������T������%�C��Z�C����i�)>��FindStr��C��FindStr/��������3>��FindStr��C��FindStr/��CC��� ���
���	��F����
������S%�CC�	FindStrH.C��FindStrH/��
�$CC�	FindStrH.C��FindStrH/��Z
	��+�T��
��a���B�T��
��-�����UNCURRENTCOLTHISPARENTACTIVECOLUMN	CTEMPTEXTVALUEINTHISFORMSETHEX2DECTHISFORMGRDCHARCOLUMNSREFRESHCMDFINDENABLEDKeyPress,��GotFocus���InteractiveChange��1��A��AAAA�A�A��Aa���AAAAA�Q���3�AA�CA���A33!����AAAQ�A�AA3b���1A�C4���AA5t7��
BH#KW)E	VPROCEDURE KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
*  Bypass the grid cell's default keystrokes.

*Must be numeric or in "ABCDEF"
DO CASE
CASE BETWEEN(nKeyCode, 31, 126) OR BETWEEN(nKeyCode,129,255)	&& Printable letters
	IF !(CHR(nKeyCode)$"1234567890abcdefABCDEF")		&& Only allow Hex digits
		?? CHR(7)		
		NODEFAULT
	ENDIF
	RETURN
CASE nKeyCode = 1	&& Home
	NODEFAULT
	THIS.PARENT.PARENT.Columns(1).SETFOCUS
CASE nKeyCode = 6	&& End
	NODEFAULT
	THIS.PARENT.PARENT.Columns(15).SETFOCUS
CASE nKeyCode = 13	&& Return
	NODEFAULT
	THISFORM.cmdFind.Click
CASE nKeyCode = 127	OR nKeyCode = 7&& Backspace
	NODEFAULT
	nActiveColumn = THIS.PARENT.PARENT.ActiveColumn
	IF nActiveColumn < 15
		IF !ISBLANK(THIS.PARENT.PARENT.Columns(nActiveColumn + 1).Text1.Value)
			** Cell to right isn't blank.  Just move pointer.
			IF nActiveColumn > 1 AND nKeyCode = 127
				THIS.PARENT.PARENT.Columns(nActiveColumn - 1).SETFOCUS
			ENDIF
			RETURN
		ENDIF
	ENDIF
	** If we made it here, we can delete and move freely.
	THIS.VALUE = ""			&& since we issue NODEFAULT, the value is not stored as we lose focus.
	cFieldName = "FindStr.C" + ALLTRIM(STR(nActiveColumn,2,0))
	REPLACE (cFieldName) WITH ""		&& Do it manually.
	THISFORM.grdHex.Columns(nActiveColumn).Text1.Value = ""
	cFieldName = "FindStrH.C" + ALLTRIM(STR(nActiveColumn,2,0))
	REPLACE (cFieldName) WITH ""
	IF nActiveColumn > 1 AND nKeyCode = 127
		THIS.PARENT.PARENT.Columns(nActiveColumn - 1).SETFOCUS
	ELSE
		*  If there is nothing to search for, disable the Find button.
		IF !ISNULL(EVAL("FindStrH." + FIELD(1,"FindStrH"))) ;
			AND !ISBLANK(EVAL("FindStrH." + FIELD(1, "FindStrH")))
			THISFORM.cmdFind.Enabled = .T.
		ELSE
			THISFORM.cmdFind.Enabled = .F.
		ENDIF
	ENDIF
	THISFORM.REFRESH
CASE nKeyCode = 9 		&& Tab
	** Default for the grid is to move to next field in grid.  Needs to move focus to
	** next control.
	NODEFAULT
	THISFORM.optSearchDirection.OPTION1.SETFOCUS
CASE nKeyCode = 15		&& ShiftTab.
	NODEFAULT
	THISFORM.Lockscreen = .T.
	THISFORM.grdChar.Columns(This.parent.parent.ActiveColumn).SETFOCUS
	THISFORM.Lockscreen = .F.
ENDCASE

ENDPROC
PROCEDURE GotFocus
** To make grid act more like textbox, make focus move to cell just after last
** non-blank cell if user clicks to the right of non-blank cells
WITH THIS.PARENT.PARENT
nPreviousColumn = .ActiveColumn - 1
IF nPreviousColumn > 0 AND ISBLANK(ALLTRIM(.COLUMNS(nPreviousColumn).Text1.VALUE))
	THISFORM.LOCKSCREEN = .T.
	FOR nCurrentCol = nPreviousColumn to 1 STEP -1
		IF !ISBLANK(ALLTRIM(.COLUMNS(nCurrentCol).Text1.VALUE))
			EXIT
		ENDIF
	NEXT
	IF nCurrentCol != nPreviouscolumn		&& Did we have to move?
		.COLUMNS(nCurrentCol + 1).SETFOCUS
		.REFRESH
	ENDIF
	THISFORM.LOCKSCREEN = .F.
ENDIF
ENDWITH

ENDPROC
PROCEDURE InteractiveChange
** This cell has been edited.  Translate and update Character grid.
nCurrentCol = THIS.PARENT.PARENT.ActiveColumn
cTempText = THIS.VALUE

IF ISBLANK(cTempText) OR ISNULL(cTempText)
	REPLACE (FIELD(nCurrentCol, "FindStr")) WITH "" IN "FindStr"
ELSE
	REPLACE (FIELD(nCurrentCol, "FindStr")) WITH CHR(THISFORMSET.HEX2DEC(cTempText)) IN "FindStr"
ENDIF
*THISFORM.grdChar.Columns(nCurrentCol).REFRESH
WITH THISFORM
	*  Update the Hex grid.
*	.grdHex.Columns(nCurrentCol).Text1.Value = cTempText
	.grdChar.Columns(nCurrentCol).REFRESH
	
	*  If there is something to search for, enable the Find button.
	IF !ISNULL(EVAL("FindStrH." + FIELD(1,"FindStrH"))) ;
		AND !ISBLANK(EVAL("FindStrH." + FIELD(1, "FindStrH")))
		.cmdFind.Enabled = .T.
	ELSE
		.cmdFind.Enabled = .F.
	ENDIF
ENDWITH




ENDPROC
�FontName = "Courier"
FontSize = 8
BorderStyle = 0
Format = ""
Height = 21
InputMask = "XX"
Margin = 0
SpecialEffect = 1
Width = 100
Name = "txtfindstringhex"
textbox