mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
[svn] * Removal of not needed old DBC tools
--HG-- branch : trunk
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
[TaxiNodes.dbc]
|
||||
ColType2=0
|
||||
ColType3=1
|
||||
ColType4=1
|
||||
[SpellRange.dbc]
|
||||
ColType2=0
|
||||
ColType3=0
|
||||
ColType1=0
|
||||
[Talent.dbc]
|
||||
ColType1=0
|
||||
ColType5=0
|
||||
ColType4=0
|
||||
[test.dbc]
|
||||
ColType1=0
|
||||
ColType3=1
|
||||
ColType2=0
|
||||
[TalentTab.dbc]
|
||||
ColType15=2
|
||||
[TalentTab_new.dbc]
|
||||
ColType15=2
|
||||
[SpellIcon.dbc]
|
||||
ColType2=0
|
||||
ColType1=0
|
||||
[FactionGroup.dbc]
|
||||
ColType12=0
|
||||
ColType3=2
|
||||
ColType2=0
|
||||
ColType8=0
|
||||
[gtRegenMPPerSpt.dbc]
|
||||
ColType1=1
|
||||
[gtOCTRegenMP.dbc]
|
||||
ColType1=1
|
||||
[gtOCTRegenHP.dbc]
|
||||
ColType1=1
|
||||
@@ -1,26 +0,0 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "SearchFrm.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
TFrmSearch *FrmSearch;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TFrmSearch::TFrmSearch(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFrmSearch::btOkClick(TObject *Sender)
|
||||
{
|
||||
ModalResult = mrOk;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFrmSearch::btCancelClick(TObject *Sender)
|
||||
{
|
||||
ModalResult = mrCancel;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
Binary file not shown.
@@ -1,63 +0,0 @@
|
||||
object FrmSearch: TFrmSearch
|
||||
Left = 261
|
||||
Top = 194
|
||||
Width = 324
|
||||
Height = 215
|
||||
Caption = 'Seach F3 Seach Next'
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object lbseach: TLabel
|
||||
Left = 48
|
||||
Top = 16
|
||||
Width = 57
|
||||
Height = 17
|
||||
AutoSize = False
|
||||
Caption = 'Input:'
|
||||
end
|
||||
object rgSI: TRadioGroup
|
||||
Left = 64
|
||||
Top = 40
|
||||
Width = 185
|
||||
Height = 97
|
||||
Caption = 'Seach Dir'
|
||||
ItemIndex = 1
|
||||
Items.Strings = (
|
||||
'Seach up'
|
||||
'Seach down'
|
||||
'Seach up Current rol'
|
||||
'Seach down Current rol')
|
||||
TabOrder = 0
|
||||
end
|
||||
object edSeach: TEdit
|
||||
Left = 120
|
||||
Top = 16
|
||||
Width = 121
|
||||
Height = 21
|
||||
TabOrder = 1
|
||||
end
|
||||
object btOk: TButton
|
||||
Left = 64
|
||||
Top = 152
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Ok'
|
||||
TabOrder = 2
|
||||
OnClick = btOkClick
|
||||
end
|
||||
object btCancel: TButton
|
||||
Left = 176
|
||||
Top = 152
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Cancel'
|
||||
TabOrder = 3
|
||||
OnClick = btCancelClick
|
||||
end
|
||||
end
|
||||
@@ -1,29 +0,0 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#ifndef SearchFrmH
|
||||
#define SearchFrmH
|
||||
//---------------------------------------------------------------------------
|
||||
#include <Classes.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
class TFrmSearch : public TForm
|
||||
{
|
||||
__published: // IDE-managed Components
|
||||
TRadioGroup *rgSI;
|
||||
TEdit *edSeach;
|
||||
TLabel *lbseach;
|
||||
TButton *btOk;
|
||||
TButton *btCancel;
|
||||
void __fastcall btOkClick(TObject *Sender);
|
||||
void __fastcall btCancelClick(TObject *Sender);
|
||||
private: // User declarations
|
||||
public: // User declarations
|
||||
__fastcall TFrmSearch(TComponent* Owner);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
extern PACKAGE TFrmSearch *FrmSearch;
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
@@ -1,26 +0,0 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "TitleFrm.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
TFrmTitle *FrmTitle;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TFrmTitle::TFrmTitle(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFrmTitle::Button1Click(TObject *Sender)
|
||||
{
|
||||
ModalResult = mrOk;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFrmTitle::Button2Click(TObject *Sender)
|
||||
{
|
||||
ModalResult = mrCancel;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
Binary file not shown.
@@ -1,51 +0,0 @@
|
||||
object FrmTitle: TFrmTitle
|
||||
Left = 328
|
||||
Top = 252
|
||||
Width = 235
|
||||
Height = 112
|
||||
BorderIcons = [biSystemMenu]
|
||||
Caption = 'Col Title'
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poDesktopCenter
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object Label1: TLabel
|
||||
Left = 8
|
||||
Top = 24
|
||||
Width = 65
|
||||
Height = 13
|
||||
AutoSize = False
|
||||
Caption = 'Title:'
|
||||
end
|
||||
object edTitle: TEdit
|
||||
Left = 80
|
||||
Top = 16
|
||||
Width = 121
|
||||
Height = 21
|
||||
TabOrder = 0
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 24
|
||||
Top = 48
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Ok'
|
||||
TabOrder = 1
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 136
|
||||
Top = 48
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Cancel'
|
||||
TabOrder = 2
|
||||
OnClick = Button2Click
|
||||
end
|
||||
end
|
||||
@@ -1,27 +0,0 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#ifndef TitleFrmH
|
||||
#define TitleFrmH
|
||||
//---------------------------------------------------------------------------
|
||||
#include <Classes.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
class TFrmTitle : public TForm
|
||||
{
|
||||
__published: // IDE-managed Components
|
||||
TLabel *Label1;
|
||||
TEdit *edTitle;
|
||||
TButton *Button1;
|
||||
TButton *Button2;
|
||||
void __fastcall Button1Click(TObject *Sender);
|
||||
void __fastcall Button2Click(TObject *Sender);
|
||||
private: // User declarations
|
||||
public: // User declarations
|
||||
__fastcall TFrmTitle(TComponent* Owner);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
extern PACKAGE TFrmTitle *FrmTitle;
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
@@ -1,313 +0,0 @@
|
||||
[FactionGroup.dbc]
|
||||
ColType3=2
|
||||
[Spell.dbc]
|
||||
ColTitle1=Id
|
||||
ColTitle2=Category
|
||||
ColTitle3=castUI
|
||||
ColTitle4=Dispel
|
||||
ColTitle5=Mechanic
|
||||
ColTitle6=Attributes
|
||||
ColTitle7=AttributesEx;
|
||||
ColTitle8=AttributesEx2;
|
||||
ColTitle9=AttributesEx3;
|
||||
ColTitle10=AttributesEx4;
|
||||
ColTitle11=AttributesEx5;
|
||||
ColTitle12=AttributesEx6;
|
||||
ColTitle13=Stances;
|
||||
ColTitle14=StancesNot;
|
||||
ColTitle15=Targets;
|
||||
ColTitle16=TargetCreatureType;
|
||||
ColTitle17=RequiresSpellFocus;
|
||||
ColTitle18=FacingCasterFlags;
|
||||
ColTitle19=CasterAuraState;
|
||||
ColTitle20=TargetAuraState;
|
||||
ColTitle21=CasterAuraStateNot;
|
||||
ColTitle22=TargetAuraStateNot;
|
||||
ColTitle23=CastingTimeIndex;
|
||||
ColTitle24=RecoveryTime;
|
||||
ColTitle25=CategoryRecoveryTime;
|
||||
ColTitle26=InterruptFlags;
|
||||
ColTitle27=AuraInterruptFlags;
|
||||
ColTitle28=ChannelInterruptFlags;
|
||||
ColTitle29=procFlags;
|
||||
ColTitle30=procChance;
|
||||
ColTitle31=procCharges;
|
||||
ColTitle32=maxLevel;
|
||||
ColTitle33=baseLevel;
|
||||
ColTitle34=spellLevel;
|
||||
ColTitle35=DurationIndex;
|
||||
ColTitle36=powerType;
|
||||
ColTitle37=manaCost;
|
||||
ColTitle38=manaCostPerlevel;
|
||||
ColTitle39=manaPerSecond;
|
||||
ColTitle40=manaPerSecondPerLevel;
|
||||
ColTitle41=rangeIndex;
|
||||
ColTitle42=floatspeed;
|
||||
ColTitle43=modalNextSpell;//38
|
||||
ColTitle44=StackAmount;
|
||||
ColTitle45=Totem1
|
||||
ColTitle46=Totem2
|
||||
ColTitle47=Reagent
|
||||
ColTitle48=Reagent2
|
||||
ColTitle49=Reagent3
|
||||
ColTitle50=Reagent4
|
||||
ColTitle51=Reagent5
|
||||
ColTitle52=Reagent6
|
||||
ColTitle53=Reagent7
|
||||
ColTitle54=Reagent8
|
||||
ColTitle55=ReagentCount1
|
||||
ColTitle56=ReagentCount2
|
||||
ColTitle57=ReagentCount3
|
||||
ColTitle58=ReagentCount4
|
||||
ColTitle59=ReagentCount5
|
||||
ColTitle60=ReagentCount6
|
||||
ColTitle61=ReagentCount7
|
||||
ColTitle62=ReagentCount8
|
||||
|
||||
ColTitle63=EqpItemClass
|
||||
ColTitle64=EquipItemSubClassMask
|
||||
ColTitle65=ItemInventoryTypeMask
|
||||
ColTitle66=Effect
|
||||
ColTitle67=Effect2
|
||||
ColTitle68=Effect3
|
||||
ColTitle69=EffectDieSides1
|
||||
ColTitle70=EffectDieSides2
|
||||
ColTitle71=EffectDieSides3
|
||||
ColTitle72=EffectBaseDice1
|
||||
ColTitle73=EffectBaseDice2
|
||||
ColTitle74=EffectBaseDice3
|
||||
ColTitle75=EffectDicePerLevel1
|
||||
ColTitle76=EffectDicePerLevel2
|
||||
ColTitle77=EffectDicePerLevel3
|
||||
ColTitle78=EffectRealPointsPerLevel1
|
||||
ColTitle79=EffectRealPointsPerLevel2
|
||||
ColTitle80=EffectRealPointsPerLevel3
|
||||
ColTitle81=BasePoints1
|
||||
ColTitle82=BasePoints2
|
||||
ColTitle83=BasePoints3
|
||||
ColTitle84=EffectMechanic1
|
||||
ColTitle85=EffectMechanic2
|
||||
ColTitle86=EffectMechanic3
|
||||
|
||||
|
||||
ColTitle87=ImplicTargA1
|
||||
ColTitle88=ImplicTargA2
|
||||
ColTitle89=ImplicTargA3
|
||||
ColTitle90=ImplicTargB1
|
||||
ColTitle91=ImplicTargB2
|
||||
ColTitle92=ImplicTargB3
|
||||
ColTitle93=RadiusIndex1
|
||||
ColTitle94=RadiusIndex2
|
||||
ColTitle95=RadiusIndex3
|
||||
ColTitle96=ApplyAuraName1
|
||||
ColTitle97=ApplyAuraName2
|
||||
ColTitle98=ApplyAuraName3
|
||||
ColTitle99=Amplitude1
|
||||
ColTitle100=Amplitude2
|
||||
ColTitle101=Amplitude3
|
||||
ColTitle102=MultiVal1
|
||||
ColTitle103=MultiVal2
|
||||
ColTitle104=MultiVal3
|
||||
ColTitle105=ChainTarg1
|
||||
ColTitle106=ChainTarg2
|
||||
ColTitle107=ChainTarg3
|
||||
ColTitle108=EffectItemType1
|
||||
ColTitle109=EffectItemType2
|
||||
ColTitle110=EffectItemType3
|
||||
ColTitle111=EffectMiscVal1
|
||||
ColTitle112=EffectMiscVal2
|
||||
ColTitle113=EffectMiscVal3
|
||||
ColTitle114=EffectMiscValB1
|
||||
ColTitle115=EffectMiscValB2
|
||||
ColTitle116=EffectMiscValB3
|
||||
ColTitle117=EffectTriggerSpell1
|
||||
ColTitle118=EffectTriggerSpell2
|
||||
ColTitle119=EffectTriggerSpell3
|
||||
ColTitle120=EffectPointsPerComboPoint1
|
||||
ColTitle121=EffectPointsPerComboPoint2
|
||||
ColTitle122=EffectPointsPerComboPoint3
|
||||
ColTitle123=SpellVisual
|
||||
ColTitle125=SpellIconID
|
||||
ColTitle126=activeIconID
|
||||
ColTitle127=spellPriority
|
||||
ColTitle128=SpellName1
|
||||
ColTitle129=SpellName2
|
||||
ColTitle130=SpellName3
|
||||
ColTitle131=SpellName4
|
||||
ColTitle132=SpellName5
|
||||
ColTitle133=SpellName6
|
||||
ColTitle134=SpellName7
|
||||
ColTitle135=SpellName8
|
||||
ColTitle136=SpellName9
|
||||
ColTitle137=SpellName10
|
||||
ColTitle138=SpellName11
|
||||
ColTitle139=SpellName12
|
||||
ColTitle140=SpellName13
|
||||
ColTitle141=SpellName14
|
||||
ColTitle142=SpellName15
|
||||
ColTitle143=SpellName16
|
||||
ColTitle144=SpellNameFlag
|
||||
ColTitle145=Rank1
|
||||
ColTitle146=Rank2
|
||||
ColTitle147=Rank3
|
||||
ColTitle148=Rank4
|
||||
ColTitle149=Rank5
|
||||
ColTitle150=Rank6
|
||||
ColTitle151=Rank7
|
||||
ColTitle152=Rank8
|
||||
ColTitle153=Rank9
|
||||
ColTitle154=Rank10
|
||||
ColTitle155=Rank11
|
||||
ColTitle156=Rank12
|
||||
ColTitle157=Rank13
|
||||
ColTitle158=Rank14
|
||||
ColTitle159=Rank15
|
||||
ColTitle160=Rank16
|
||||
ColTitle161=RankFlags
|
||||
ColTitle162=Description1
|
||||
ColTitle163=Description2
|
||||
ColTitle164=Description3
|
||||
ColTitle165=Description4
|
||||
ColTitle166=Description5
|
||||
ColTitle167=Description6
|
||||
ColTitle168=Description7
|
||||
ColTitle169=Description8
|
||||
ColTitle170=Description9
|
||||
ColTitle171=Description10
|
||||
ColTitle172=Description11
|
||||
ColTitle173=Description12
|
||||
ColTitle174=Description13
|
||||
ColTitle175=Description14
|
||||
ColTitle176=Description15
|
||||
ColTitle177=Description16
|
||||
ColTitle178=DescriptionFlags
|
||||
ColTitle179=ToolTip1
|
||||
ColTitle180=ToolTip2
|
||||
ColTitle181=ToolTip3
|
||||
ColTitle182=ToolTip4
|
||||
ColTitle183=ToolTip5
|
||||
ColTitle184=ToolTip6
|
||||
ColTitle185=ToolTip7
|
||||
ColTitle186=ToolTip8
|
||||
ColTitle187=ToolTip9
|
||||
ColTitle188=ToolTip10
|
||||
ColTitle189=ToolTip11
|
||||
ColTitle190=ToolTip12
|
||||
ColTitle191=ToolTip13
|
||||
ColTitle192=ToolTip14
|
||||
ColTitle193=ToolTip15
|
||||
ColTitle194=ToolTip16
|
||||
ColTitle195=ToolTipFlags
|
||||
ColTitle196=ManaCostPercentage
|
||||
ColTitle197=StartRecoveryCategory
|
||||
ColTitle198=StartRecoveryTime
|
||||
ColTitle199=MaxTargetLevel
|
||||
ColTitle200=SpellFamilyName
|
||||
ColTitle201=SpellFamilyFlags1
|
||||
ColTitle202=SpellFamilyFlags2
|
||||
ColTitle203=MaxAffectedTargets
|
||||
ColTitle204=DmgClass
|
||||
ColTitle205=PreventionType
|
||||
ColTitle206=StanceBarOrder
|
||||
ColTitle207=DmgMultiplier1
|
||||
ColTitle208=DmgMultiplier2
|
||||
ColTitle209=DmgMultiplier3
|
||||
ColTitle210=MinFactionId
|
||||
ColTitle211=MinReputation
|
||||
ColTitle212=RequiredAuraVision
|
||||
ColTitle213=TotemCategory1
|
||||
ColTitle214=TotemCategory2
|
||||
ColTitle215=AreaId
|
||||
ColTitle216=SchoolMask
|
||||
ColType102=1
|
||||
ColType103=1
|
||||
ColType104=1
|
||||
ColType128=2
|
||||
ColType129=2
|
||||
ColType130=2
|
||||
ColType131=2
|
||||
ColType132=2
|
||||
ColType133=2
|
||||
ColType134=2
|
||||
ColType135=2
|
||||
ColType136=2
|
||||
ColType137=2
|
||||
ColType138=2
|
||||
ColType139=2
|
||||
ColType140=2
|
||||
ColType141=2
|
||||
ColType142=2
|
||||
ColType143=2
|
||||
ColType145=2
|
||||
ColType146=2
|
||||
ColType147=2
|
||||
ColType148=2
|
||||
ColType149=2
|
||||
ColType150=2
|
||||
ColType151=2
|
||||
ColType152=2
|
||||
ColType153=2
|
||||
ColType154=2
|
||||
ColType155=2
|
||||
ColType157=2
|
||||
ColType156=2
|
||||
ColType158=2
|
||||
ColType159=2
|
||||
ColType160=2
|
||||
ColType162=2
|
||||
ColType163=2
|
||||
ColType164=2
|
||||
ColType165=2
|
||||
ColType166=2
|
||||
ColType167=2
|
||||
ColType168=2
|
||||
ColType169=2
|
||||
ColType170=2
|
||||
ColType171=2
|
||||
ColType172=2
|
||||
ColType173=2
|
||||
ColType174=2
|
||||
ColType175=2
|
||||
ColType176=2
|
||||
ColType177=2
|
||||
ColType179=2
|
||||
ColType180=2
|
||||
ColType181=2
|
||||
ColType182=2
|
||||
ColType183=2
|
||||
ColType184=2
|
||||
ColType185=2
|
||||
ColType186=2
|
||||
ColType187=2
|
||||
ColType188=2
|
||||
ColType189=2
|
||||
ColType190=2
|
||||
ColType191=2
|
||||
ColType192=2
|
||||
ColType193=2
|
||||
ColType194=2
|
||||
ColType208=1
|
||||
ColType209=1
|
||||
ColType207=1
|
||||
[Map.dbc]
|
||||
ColType2=2
|
||||
ColType8=0
|
||||
[AreaTrigger.dbc]
|
||||
ColTitle3=x
|
||||
ColTitle4=y
|
||||
ColTitle5=z
|
||||
ColTitle1=id
|
||||
ColTitle2=map
|
||||
ColType3=1
|
||||
ColType4=1
|
||||
ColType5=1
|
||||
ColType6=1
|
||||
ColType7=1
|
||||
ColType8=1
|
||||
ColType9=1
|
||||
ColType10=1
|
||||
ColTitle6=radius
|
||||
ColTitle7=box x
|
||||
ColTitle8=box y
|
||||
ColTitle9=box z
|
||||
ColTitle10=box orientation
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,11 +0,0 @@
|
||||
1.4版更新
|
||||
1.修正退出时有时退不出的bug
|
||||
2.加入可查找的功能
|
||||
3.加入列切换类型后立即刷新
|
||||
4.加入可以当前单元格写入打开文件的功能
|
||||
5.加入每一列的宽度可调整
|
||||
6.加入支持文本显示,但不能修改,文本修改后不会存入
|
||||
|
||||
1.41版
|
||||
1.可以固定和取消第一列,以方便查看Spell ID
|
||||
2.可以行存,列存,行清,列清,调用计算器
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,769 +0,0 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "dbcedit.h"
|
||||
#include "stdio.h"
|
||||
#include "IdGlobal.hpp"
|
||||
#include <inifiles.hpp>
|
||||
#include "TitleFrm.h"
|
||||
#include <dir.h>
|
||||
#include "thOpenSource.h"
|
||||
#include "SearchFrm.h"
|
||||
//#include "SysUtils.hpp"
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
TFrmMain *FrmMain;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TFrmMain::TFrmMain(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
OpenOk=false;
|
||||
Term=false;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::btOpenClick(TObject *Sender)
|
||||
{
|
||||
if(OpenDialog1->Execute()){
|
||||
if (FileExists(OpenDialog1->FileName)){
|
||||
OpenOk=false;
|
||||
if(thOpen){
|
||||
thOpen->Terminate();
|
||||
}
|
||||
thOpen = new thOpenFile(false);
|
||||
//thOpen->Priority = tpTimeCritical;
|
||||
pnFileName->Caption = OpenDialog1->FileName;
|
||||
}else{
|
||||
OpenOk=false;
|
||||
pnFileName->Caption = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFrmMain::btSaveClick(TObject *Sender)
|
||||
{
|
||||
//CurrentOpenFile;
|
||||
if(OpenOk){
|
||||
SaveToFile(CurrentOpenFile.c_str());
|
||||
}else{
|
||||
ShowMessage("文件未打开完成!");
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void TFrmMain::SaveToFile(const char * pszFileName)
|
||||
{
|
||||
char szFileName[255];
|
||||
FILE *stream;
|
||||
|
||||
|
||||
|
||||
|
||||
fnsplit(pszFileName, 0, 0, szFileName, 0);
|
||||
strcat(szFileName, "_new.dbc");
|
||||
|
||||
|
||||
AnsiString NewFileName=ExtractFilePath(Application->ExeName)+szFileName;//=pszFileName;
|
||||
int iFileHandle; //文件句柄
|
||||
AnsiString iniSetFile=ExtractFilePath(Application->ExeName)+"BcdEditer.ini";
|
||||
AnsiString SectionName=ExtractFileName(CurrentOpenFile);
|
||||
|
||||
DWORD w;
|
||||
|
||||
CopyFileTo(pszFileName,NewFileName);
|
||||
|
||||
iFileHandle = FileOpen(NewFileName, fmOpenRead|fmOpenWrite);//打开文件
|
||||
|
||||
if ((stream = fopen(CurrentOpenFile.c_str(), "r+"))
|
||||
== NULL)
|
||||
{
|
||||
ShowMessage("打开文件出错");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int iVal;
|
||||
float fVal;
|
||||
bool isFloat;
|
||||
int ColType;
|
||||
|
||||
FileSeek(iFileHandle,0x14,0);
|
||||
TIniFile *ini;
|
||||
ini = new TIniFile( iniSetFile );
|
||||
|
||||
for(int i=1; i<sgEdit->RowCount; i++)
|
||||
{
|
||||
for(int j=1; j<sgEdit->ColCount; j++)
|
||||
{
|
||||
if(j==1){ //ID
|
||||
iVal=StrToInt(sgEdit->Cells[j][i]);
|
||||
FileWrite(iFileHandle, &iVal, 4);
|
||||
}else{
|
||||
|
||||
//ColType= ini->ReadInteger(SectionName,"ColType"+IntToStr(j-1),0);
|
||||
//thOpen->ColType[10000];
|
||||
|
||||
switch (thOpen->ColType[j])
|
||||
{
|
||||
case 0: //整型
|
||||
iVal=StrToFloat(sgEdit->Cells[j][i]);
|
||||
FileWrite(iFileHandle, &iVal, 4);
|
||||
break;
|
||||
case 1: //浮点
|
||||
fVal=StrToFloat(sgEdit->Cells[j][i]);
|
||||
FileWrite(iFileHandle, &fVal, 4);
|
||||
break;
|
||||
case 2: //文本
|
||||
fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(j-1))*4, 0);
|
||||
fread(&iVal, 4, 1, stream);
|
||||
FileWrite(iFileHandle, &iVal, 4);
|
||||
break;
|
||||
default: //整型
|
||||
iVal=StrToFloat(sgEdit->Cells[j][i]);
|
||||
FileWrite(iFileHandle, &iVal, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FileClose(iFileHandle);
|
||||
fclose(stream);
|
||||
|
||||
delete ini;
|
||||
ShowMessage("Save To File:"+NewFileName);
|
||||
}
|
||||
void __fastcall TFrmMain::btIntTypeClick(TObject *Sender)
|
||||
{
|
||||
if(OpenOk==true){
|
||||
AnsiString iniSetFile=ExtractFilePath(Application->ExeName)+"BcdEditer.ini";
|
||||
AnsiString SectionName=ExtractFileName(CurrentOpenFile);
|
||||
TIniFile *ini;
|
||||
ini = new TIniFile( iniSetFile );
|
||||
ini->WriteInteger(SectionName,"ColType"+IntToStr(sgEdit->Col),0);
|
||||
delete ini;
|
||||
thOpen->ColType[sgEdit->Col]=0;
|
||||
//重新打开对应列的值
|
||||
//OpenFileCol(AnsiString FileName,int ColType);
|
||||
OpenFileCol(CurrentOpenFile,sgEdit->Col,0);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
void __fastcall TFrmMain::btFloatTypeClick(TObject *Sender)
|
||||
{
|
||||
if(OpenOk==true){
|
||||
AnsiString iniSetFile=ExtractFilePath(Application->ExeName)+"BcdEditer.ini";
|
||||
AnsiString SectionName=ExtractFileName(CurrentOpenFile);
|
||||
TIniFile *ini;
|
||||
ini = new TIniFile( iniSetFile );
|
||||
ini->WriteInteger(SectionName,"ColType"+IntToStr(sgEdit->Col),1);
|
||||
delete ini;
|
||||
thOpen->ColType[sgEdit->Col]=1;
|
||||
OpenFileCol(CurrentOpenFile,sgEdit->Col,1);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::PopupMenu1Popup(TObject *Sender)
|
||||
{
|
||||
if(OpenOk==true){
|
||||
AnsiString iniSetFile=ExtractFilePath(Application->ExeName)+"BcdEditer.ini";
|
||||
AnsiString SectionName=ExtractFileName(CurrentOpenFile);
|
||||
int ColType;
|
||||
TIniFile *ini;
|
||||
ini = new TIniFile( iniSetFile );
|
||||
ColType=ini->ReadInteger(SectionName,"ColType"+IntToStr(sgEdit->Col),0);
|
||||
delete ini;
|
||||
switch (ColType)
|
||||
{
|
||||
case 0:
|
||||
btIntType->Checked=true;
|
||||
btFloatType->Checked=false;
|
||||
btTxtType->Checked=false;
|
||||
break;
|
||||
case 1:
|
||||
btIntType->Checked=false;
|
||||
btFloatType->Checked=true;
|
||||
btTxtType->Checked=false;
|
||||
break;
|
||||
case 2:
|
||||
btIntType->Checked=false;
|
||||
btFloatType->Checked=false;
|
||||
btTxtType->Checked=true;
|
||||
break;
|
||||
default:
|
||||
btIntType->Checked=true;
|
||||
btFloatType->Checked=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::N1Click(TObject *Sender)
|
||||
{
|
||||
AnsiString iniSetFile=ExtractFilePath(Application->ExeName)+"BcdEditer.ini";
|
||||
AnsiString SectionName=ExtractFileName(CurrentOpenFile);
|
||||
int ColType;
|
||||
FrmTitle->edTitle->Text=sgEdit->Cells[sgEdit->Col][0];
|
||||
if(FrmTitle->ShowModal()==mrOk){
|
||||
TIniFile *ini;
|
||||
ini = new TIniFile( iniSetFile );
|
||||
ini->WriteString(SectionName,"ColTitle"+IntToStr(sgEdit->Col),FrmTitle->edTitle->Text);
|
||||
delete ini;
|
||||
sgEdit->Cells[sgEdit->Col][0]=FrmTitle->edTitle->Text;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
void __fastcall TFrmMain::FormDestroy(TObject *Sender)
|
||||
{
|
||||
if(thOpen){
|
||||
thOpen->Terminate();
|
||||
SleepEx(200,0);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::ToolButton1Click(TObject *Sender)
|
||||
{
|
||||
bool SeFlag=true;
|
||||
if(FrmSearch->ShowModal()==mrOk){
|
||||
switch (FrmSearch->rgSI->ItemIndex)
|
||||
{
|
||||
case 0: //向上找;
|
||||
for(int i=sgEdit->ColCount*sgEdit->Row+sgEdit->Col-1;i>sgEdit->ColCount;i--){
|
||||
if(i%sgEdit->ColCount!=0){
|
||||
if( 0==CompareStr(sgEdit->Cells[i-sgEdit->ColCount*(i/sgEdit->ColCount)][i/sgEdit->ColCount],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
sgEdit->Col=i-sgEdit->ColCount*i/sgEdit->ColCount;
|
||||
sgEdit->Row=i/sgEdit->ColCount;
|
||||
SeFlag=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(SeFlag) ShowMessage("Seach Top,Find Nothing.");
|
||||
break;
|
||||
case 1: //向下找;
|
||||
for(int i=sgEdit->ColCount*sgEdit->Row+sgEdit->Col+1;i<sgEdit->ColCount*sgEdit->RowCount;i++){
|
||||
if(i%sgEdit->ColCount!=0){
|
||||
if( 0==CompareStr(sgEdit->Cells[i-sgEdit->ColCount*(i/sgEdit->ColCount)][i/sgEdit->ColCount],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
sgEdit->Col=i-sgEdit->ColCount*(i/sgEdit->ColCount);
|
||||
sgEdit->Row=i/sgEdit->ColCount;
|
||||
SeFlag=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(SeFlag) ShowMessage("Seach End,Find Nothing");
|
||||
break;
|
||||
case 2: //当前列向上找;
|
||||
for(int i=sgEdit->Row;i>1;i--){
|
||||
if( 0==CompareStr(sgEdit->Cells[sgEdit->Col][i],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
sgEdit->Row=i;
|
||||
SeFlag=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(SeFlag) ShowMessage("Seach col top,Find Nothing");
|
||||
break;
|
||||
case 3: //当前列向下找;
|
||||
for(int i=sgEdit->Row;i<sgEdit->RowCount;i++){
|
||||
if( 0==CompareStr(sgEdit->Cells[sgEdit->Col][i],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
sgEdit->Row=i;
|
||||
SeFlag=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(SeFlag) ShowMessage("Seach col end,Find Nothing.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::sgEditKeyDown(TObject *Sender, WORD &Key,
|
||||
TShiftState Shift)
|
||||
{
|
||||
|
||||
bool SeFlag=true;
|
||||
if(Key==VK_F3){
|
||||
switch (FrmSearch->rgSI->ItemIndex)
|
||||
{
|
||||
case 0: //向上找;
|
||||
for(int i=sgEdit->ColCount*sgEdit->Row+sgEdit->Col-1;i>sgEdit->ColCount;i--){
|
||||
if(i%sgEdit->ColCount!=0){
|
||||
if( 0==CompareStr(sgEdit->Cells[i-sgEdit->ColCount*(i/sgEdit->ColCount)][i/sgEdit->ColCount],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
sgEdit->Col=i-sgEdit->ColCount*i/sgEdit->ColCount;
|
||||
sgEdit->Row=i/sgEdit->ColCount;
|
||||
SeFlag=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(SeFlag) ShowMessage("Seach Top,Find Nothing.");
|
||||
break;
|
||||
case 1: //向下找;
|
||||
for(int i=sgEdit->ColCount*sgEdit->Row+sgEdit->Col+1;i<sgEdit->ColCount*sgEdit->RowCount;i++){
|
||||
if(i%sgEdit->ColCount!=0){
|
||||
if( 0==CompareStr(sgEdit->Cells[i-sgEdit->ColCount*(i/sgEdit->ColCount)][i/sgEdit->ColCount],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
sgEdit->Col=i-sgEdit->ColCount*(i/sgEdit->ColCount);
|
||||
sgEdit->Row=i/sgEdit->ColCount;
|
||||
SeFlag=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(SeFlag) ShowMessage("Seach End,Find Nothing.");
|
||||
break;
|
||||
case 2: //当前列向上找;
|
||||
for(int i=sgEdit->Row;i>1;i--){
|
||||
if( 0==CompareStr(sgEdit->Cells[sgEdit->Col][i],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
sgEdit->Row=i;
|
||||
SeFlag=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(SeFlag) ShowMessage("Seach col Top,Find Nothing.");
|
||||
break;
|
||||
case 3: //当前列向下找;
|
||||
for(int i=sgEdit->Row;i<sgEdit->RowCount;i++){
|
||||
if( 0==CompareStr(sgEdit->Cells[sgEdit->Col][i],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
sgEdit->Row=i;
|
||||
SeFlag=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(SeFlag) ShowMessage("Seach col end,Find Nothing.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::sgEditSelectCell(TObject *Sender, int ACol,
|
||||
int ARow, bool &CanSelect)
|
||||
{
|
||||
//
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TFrmMain::OpenFileCol(AnsiString FileName,int ColIndex,int ColType)
|
||||
{
|
||||
int iFileHandle; //文件句柄
|
||||
char Txtbuf[255];
|
||||
int iVal;
|
||||
float fVal;
|
||||
FILE *stream;
|
||||
long curpos, length;
|
||||
DWORD dwRows, dwCols, dwRowLen, dwTextLen;
|
||||
|
||||
DWORD dwTextStartPos;
|
||||
char* pTextPtr ;
|
||||
|
||||
|
||||
if ((stream = fopen(FileName.c_str(), "r+"))
|
||||
== NULL)
|
||||
{
|
||||
ShowMessage("Open File Error");
|
||||
return;
|
||||
}
|
||||
|
||||
curpos = ftell(stream);
|
||||
fseek(stream, 0L, SEEK_END);
|
||||
length = ftell(stream);
|
||||
|
||||
|
||||
switch (ColType)
|
||||
{
|
||||
case 0: //整型值 Int
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(ColIndex-1))*4, 0);
|
||||
fread(&iVal, 4, 1, stream);
|
||||
sgEdit->Cells[ColIndex][i+1]=IntToStr(iVal);
|
||||
}
|
||||
break;
|
||||
case 1: //浮点值 Float
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(ColIndex-1))*4, 0);
|
||||
fread(&fVal, 4, 1, stream);
|
||||
sgEdit->Cells[ColIndex][i+1]=FloatToStr(fVal);
|
||||
}
|
||||
break;
|
||||
case 2: //文本 Text
|
||||
fseek(stream,0x4,0);
|
||||
fread(&iVal, 4, 1, stream);
|
||||
dwRows= iVal;
|
||||
fread(&iVal, 4, 1, stream);
|
||||
dwCols = iVal;
|
||||
fread(&iVal, 4, 1, stream);
|
||||
dwRowLen = iVal;
|
||||
fread(&iVal, 4, 1, stream);
|
||||
dwTextLen = iVal;
|
||||
|
||||
dwTextStartPos = dwRows*dwRowLen+20;
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(ColIndex-1))*4, 0);
|
||||
fread(&iVal, 4, 1, stream);
|
||||
sgEdit->Cells[ColIndex][i+1]=IntToStr(iVal);
|
||||
if(dwTextStartPos + iVal < length){
|
||||
fseek(stream,dwTextStartPos + iVal,0);
|
||||
fread(Txtbuf, 1, 255, stream);
|
||||
//pTextPtr = pBuff + dwTextStartPos + lTemp;
|
||||
sgEdit->Cells[ColIndex][i+1]=Txtbuf;
|
||||
}else{
|
||||
sgEdit->Cells[ColIndex][i+1]="This Col Not Text!";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
fclose(stream);
|
||||
}
|
||||
void __fastcall TFrmMain::Timer1Timer(TObject *Sender)
|
||||
{
|
||||
if(OpenOk){
|
||||
lbOpState->Caption = "Open File Ok.";
|
||||
}else{
|
||||
lbOpState->Caption = "Open Now.....";
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
//当前格子写入修改文件中
|
||||
void __fastcall TFrmMain::N4Click(TObject *Sender)
|
||||
{
|
||||
if(!thOpen) return;
|
||||
|
||||
int iFileHandle; //文件句柄
|
||||
char buf[4];
|
||||
int iVal;
|
||||
float fVal;
|
||||
FILE *stream;
|
||||
/*
|
||||
if ((stream = fopen(CurrentOpenFile.c_str(), "r+"))
|
||||
== NULL)
|
||||
{
|
||||
ShowMessage("打开文件出错");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
iFileHandle = FileOpen(CurrentOpenFile, fmOpenRead|fmOpenWrite);//打开文件
|
||||
|
||||
switch (thOpen->ColType[sgEdit->Col])
|
||||
{
|
||||
case 0: //整型值
|
||||
//for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
/*
|
||||
fseek(stream, 0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
|
||||
iVal=StrToInt(sgEdit->Cells[sgEdit->Col][sgEdit->Row]);
|
||||
memcpy(buf, &iVal, 4);
|
||||
for(int i=0;i<4;i++)
|
||||
fwrite(buf+i, 1, 1, stream);
|
||||
*/
|
||||
iVal=StrToInt(sgEdit->Cells[sgEdit->Col][sgEdit->Row]);
|
||||
memcpy(buf, &iVal, 4);
|
||||
FileSeek(iFileHandle,0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4,0);
|
||||
FileWrite(iFileHandle,buf,4);
|
||||
//}
|
||||
break;
|
||||
case 1: //浮点值
|
||||
//fseek(stream, 0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
|
||||
//fVal=StrToFloat(sgEdit->Cells[sgEdit->Col][sgEdit->Row]);
|
||||
//fwrite(&fVal, 4, 1, stream);
|
||||
fVal=StrToFloat(sgEdit->Cells[sgEdit->Col][sgEdit->Row]);
|
||||
memcpy(buf, &fVal, 4);
|
||||
FileSeek(iFileHandle,0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4,0);
|
||||
FileWrite(iFileHandle,buf,4);
|
||||
break;
|
||||
case 2: //文本不写入
|
||||
break;
|
||||
}
|
||||
|
||||
// fclose(stream);
|
||||
FileClose(iFileHandle);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::btTxtTypeClick(TObject *Sender)
|
||||
{
|
||||
if(OpenOk==true){
|
||||
AnsiString iniSetFile=ExtractFilePath(Application->ExeName)+"BcdEditer.ini";
|
||||
AnsiString SectionName=ExtractFileName(CurrentOpenFile);
|
||||
TIniFile *ini;
|
||||
ini = new TIniFile( iniSetFile );
|
||||
ini->WriteInteger(SectionName,"ColType"+IntToStr(sgEdit->Col),2);
|
||||
delete ini;
|
||||
thOpen->ColType[sgEdit->Col]=2;
|
||||
OpenFileCol(CurrentOpenFile,sgEdit->Col,2);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::ToolButton3Click(TObject *Sender)
|
||||
{
|
||||
int OldCol;
|
||||
int OldRow;
|
||||
OldRow=sgEdit->Row;
|
||||
OldCol=sgEdit->Col;
|
||||
if(sgEdit->FixedCols==1){
|
||||
sgEdit->FixedCols =2;
|
||||
if(OldCol!=1)
|
||||
sgEdit->Col=OldCol;
|
||||
sgEdit->Row=OldRow;
|
||||
}else{
|
||||
sgEdit->FixedCols =1;
|
||||
sgEdit->Row=OldRow;
|
||||
if(OldCol!=2)
|
||||
sgEdit->Col=OldCol;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::btRowSaveClick(TObject *Sender)
|
||||
{
|
||||
if(OpenOk==false) return;
|
||||
|
||||
int iFileHandle; //文件句柄
|
||||
char Txtbuf[255];
|
||||
int iVal;
|
||||
char buf[4];
|
||||
float fVal;
|
||||
FILE *stream;
|
||||
long curpos, length;
|
||||
DWORD dwRows, dwCols, dwRowLen, dwTextLen;
|
||||
|
||||
DWORD dwTextStartPos;
|
||||
char* pTextPtr ;
|
||||
|
||||
|
||||
//if ((stream = fopen(CurrentOpenFile.c_str(), "r+"))
|
||||
// == NULL)
|
||||
//{
|
||||
// ShowMessage("打开文件出错");
|
||||
// return;
|
||||
//}
|
||||
|
||||
//curpos = ftell(stream);
|
||||
//fseek(stream, 0L, SEEK_END);
|
||||
//length = ftell(stream);
|
||||
iFileHandle = FileOpen(CurrentOpenFile, fmOpenRead|fmOpenWrite);//打开文件
|
||||
|
||||
for(int i=0;i<sgEdit->ColCount-1;i++){
|
||||
switch (thOpen->ColType[i])
|
||||
{
|
||||
case 0: //整型值 sgEdit->Row
|
||||
//fseek(stream, 0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+i)*4, 0);
|
||||
//iVal=StrToInt(sgEdit->Cells[i+1][sgEdit->Row]);
|
||||
//fwrite(&iVal, 4, 1, stream);
|
||||
iVal=StrToInt(sgEdit->Cells[i+1][sgEdit->Row]);
|
||||
memcpy(buf, &iVal, 4);
|
||||
FileSeek(iFileHandle,0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+i)*4,0);
|
||||
FileWrite(iFileHandle,buf,4);
|
||||
break;
|
||||
case 1: //浮点值
|
||||
//fseek(stream, 0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+i)*4, 0);
|
||||
//fVal=StrToFloat(sgEdit->Cells[i+1][sgEdit->Row]);
|
||||
//fwrite(&fVal, 4, 1, stream);
|
||||
fVal=StrToFloat(sgEdit->Cells[i+1][sgEdit->Row]);
|
||||
memcpy(buf, &fVal, 4);
|
||||
FileSeek(iFileHandle,0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+i)*4,0);
|
||||
FileWrite(iFileHandle,buf,4);
|
||||
break;
|
||||
case 2: //文本 不存
|
||||
break;
|
||||
}
|
||||
}
|
||||
//fclose(stream);
|
||||
FileClose(iFileHandle);
|
||||
ShowMessage("The "+IntToStr(sgEdit->Row)+" Row Write Ok!");
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::btColSaveClick(TObject *Sender)
|
||||
{
|
||||
if(OpenOk==false) return;
|
||||
|
||||
int iFileHandle; //文件句柄
|
||||
char Txtbuf[255];
|
||||
int iVal;
|
||||
char buf[4];
|
||||
float fVal;
|
||||
FILE *stream;
|
||||
long curpos, length;
|
||||
DWORD dwRows, dwCols, dwRowLen, dwTextLen;
|
||||
|
||||
DWORD dwTextStartPos;
|
||||
char* pTextPtr ;
|
||||
|
||||
iFileHandle = FileOpen(CurrentOpenFile, fmOpenRead|fmOpenWrite);//打开文件
|
||||
|
||||
//if ((stream = fopen(CurrentOpenFile.c_str(), "r+"))
|
||||
// == NULL)
|
||||
//{
|
||||
// ShowMessage("打开文件出错");
|
||||
// return;
|
||||
//}
|
||||
|
||||
//curpos = ftell(stream);
|
||||
//fseek(stream, 0L, SEEK_END);
|
||||
//length = ftell(stream);
|
||||
|
||||
|
||||
switch (thOpen->ColType[sgEdit->Col])
|
||||
{
|
||||
case 0: //整型值
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
//fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
|
||||
//iVal=StrToInt(sgEdit->Cells[sgEdit->Col][i+1]);
|
||||
//fwrite(&iVal, 4, 1, stream);
|
||||
iVal=StrToInt(sgEdit->Cells[sgEdit->Col][i+1]);
|
||||
memcpy(buf, &iVal, 4);
|
||||
FileSeek(iFileHandle,0x14+(i*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4,0);
|
||||
FileWrite(iFileHandle,buf,4);
|
||||
}
|
||||
break;
|
||||
case 1: //浮点值
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
//fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
|
||||
//fVal=StrToFloat(sgEdit->Cells[sgEdit->Col][i+1]);
|
||||
//fwrite(&fVal, 4, 1, stream);
|
||||
fVal=StrToFloat(sgEdit->Cells[sgEdit->Col][i+1]);
|
||||
memcpy(buf, &fVal, 4);
|
||||
FileSeek(iFileHandle,0x14+(i*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4,0);
|
||||
FileWrite(iFileHandle,buf,4);
|
||||
}
|
||||
break;
|
||||
case 2: //文本 不存
|
||||
break;
|
||||
}
|
||||
//fclose(stream);
|
||||
|
||||
FileClose(iFileHandle);
|
||||
ShowMessage("The "+IntToStr(sgEdit->Col)+"Col Write Ok!");
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::btRowClearClick(TObject *Sender)
|
||||
{
|
||||
if(OpenOk==false) return;
|
||||
|
||||
int iFileHandle; //文件句柄
|
||||
char Txtbuf[255];
|
||||
int iVal;
|
||||
float fVal;
|
||||
FILE *stream;
|
||||
long curpos, length;
|
||||
DWORD dwRows, dwCols, dwRowLen, dwTextLen;
|
||||
|
||||
DWORD dwTextStartPos;
|
||||
char* pTextPtr ;
|
||||
|
||||
|
||||
if ((stream = fopen(CurrentOpenFile.c_str(), "r+"))
|
||||
== NULL)
|
||||
{
|
||||
ShowMessage("Open File Error!");
|
||||
return;
|
||||
}
|
||||
|
||||
curpos = ftell(stream);
|
||||
fseek(stream, 0L, SEEK_END);
|
||||
length = ftell(stream);
|
||||
|
||||
for(int i=1;i<sgEdit->ColCount-1;i++){
|
||||
switch (thOpen->ColType[i])
|
||||
{
|
||||
case 0: //整型值 sgEdit->Row
|
||||
//fseek(stream, 0x14+(sgEdit->Row*(sgEdit->ColCount-1)+i)*4, 0);
|
||||
//iVal=StrToInt(sgEdit->Cells[i+1][sgEdit->Row]);
|
||||
//fwrite(&iVal, 4, 1, stream);
|
||||
sgEdit->Cells[i+1][sgEdit->Row]="0";
|
||||
break;
|
||||
case 1: //浮点值
|
||||
//fseek(stream, 0x14+(sgEdit->Row*(sgEdit->ColCount-1)+i)*4, 0);
|
||||
//fVal=StrToFloat(sgEdit->Cells[i+1][sgEdit->Row]);
|
||||
//fwrite(&fVal, 4, 1, stream);
|
||||
sgEdit->Cells[i+1][sgEdit->Row]="0";
|
||||
break;
|
||||
case 2: //文本 不存
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(stream);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::btColClearClick(TObject *Sender)
|
||||
{
|
||||
if(OpenOk==false) return;
|
||||
|
||||
int iFileHandle; //文件句柄
|
||||
char Txtbuf[255];
|
||||
int iVal;
|
||||
float fVal;
|
||||
FILE *stream;
|
||||
long curpos, length;
|
||||
DWORD dwRows, dwCols, dwRowLen, dwTextLen;
|
||||
|
||||
DWORD dwTextStartPos;
|
||||
char* pTextPtr ;
|
||||
|
||||
|
||||
if ((stream = fopen(CurrentOpenFile.c_str(), "r+"))
|
||||
== NULL)
|
||||
{
|
||||
ShowMessage("Open File Error!");
|
||||
return;
|
||||
}
|
||||
|
||||
curpos = ftell(stream);
|
||||
fseek(stream, 0L, SEEK_END);
|
||||
length = ftell(stream);
|
||||
|
||||
|
||||
switch (thOpen->ColType[sgEdit->Col])
|
||||
{
|
||||
case 0: //整型值
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
//fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(ColIndex-1))*4, 0);
|
||||
//iVal=StrToInt(sgEdit->Cells[ColIndex][i+1]);
|
||||
//fwrite(&iVal, 4, 1, stream);
|
||||
sgEdit->Cells[sgEdit->Col][i+1]="0";
|
||||
}
|
||||
break;
|
||||
case 1: //浮点值
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
//fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(ColIndex-1))*4, 0);
|
||||
//fVal=StrToFloat(sgEdit->Cells[ColIndex][i+1]);
|
||||
//fwrite(&fVal, 4, 1, stream);
|
||||
sgEdit->Cells[sgEdit->Col][i+1]="0";
|
||||
}
|
||||
break;
|
||||
case 2: //文本 不存
|
||||
break;
|
||||
}
|
||||
fclose(stream);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TFrmMain::ToolButton4Click(TObject *Sender)
|
||||
{
|
||||
AnsiString Cmd;
|
||||
Cmd = "calc.exe";
|
||||
WinExec(Cmd.c_str(), SW_SHOWNORMAL);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,105 +0,0 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#ifndef dbceditH
|
||||
#define dbceditH
|
||||
//---------------------------------------------------------------------------
|
||||
#include <Classes.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <ComCtrls.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
#include <ToolWin.hpp>
|
||||
#include <Grids.hpp>
|
||||
#include <Dialogs.hpp>
|
||||
#include <Menus.hpp>
|
||||
#include <ImgList.hpp>
|
||||
#include "thOpenSource.h"
|
||||
|
||||
union TypePtr
|
||||
{
|
||||
long* l;
|
||||
DWORD* dw;
|
||||
WORD* w;
|
||||
char* c;
|
||||
void* p;
|
||||
float* f;
|
||||
|
||||
TypePtr(void* in) :p(in)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#define TAG(x) (DWORD)( (((DWORD)x&0x0000ff00)<<8)+(((DWORD)x&0x000000ff)<<24)+(((DWORD)x&0x00ff0000)>>8)+(((DWORD)x&0xff000000)>>24) )
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
class TFrmMain : public TForm
|
||||
{
|
||||
__published: // IDE-managed Components
|
||||
TPanel *Panel1;
|
||||
TCoolBar *CoolBar1;
|
||||
TToolBar *ToolBar1;
|
||||
TToolButton *btOpen;
|
||||
TToolButton *btSave;
|
||||
TStringGrid *sgEdit;
|
||||
TOpenDialog *OpenDialog1;
|
||||
TPopupMenu *PopupMenu1;
|
||||
TMenuItem *N1;
|
||||
TMenuItem *N2;
|
||||
TMenuItem *btIntType;
|
||||
TMenuItem *btFloatType;
|
||||
TMenuItem *btTxtType;
|
||||
TImageList *ImageList1;
|
||||
TPanel *pnFileName;
|
||||
TToolButton *ToolButton1;
|
||||
TToolButton *ToolButton2;
|
||||
TTimer *Timer1;
|
||||
TLabel *lbOpState;
|
||||
TMenuItem *N4;
|
||||
TToolButton *ToolButton3;
|
||||
TMenuItem *btRowSave;
|
||||
TMenuItem *btColSave;
|
||||
TMenuItem *btRowClear;
|
||||
TMenuItem *btColClear;
|
||||
TToolButton *ToolButton4;
|
||||
TToolButton *ToolButton5;
|
||||
void __fastcall btOpenClick(TObject *Sender);
|
||||
void __fastcall btSaveClick(TObject *Sender);
|
||||
void __fastcall btIntTypeClick(TObject *Sender);
|
||||
void __fastcall btFloatTypeClick(TObject *Sender);
|
||||
void __fastcall PopupMenu1Popup(TObject *Sender);
|
||||
void __fastcall N1Click(TObject *Sender);
|
||||
void __fastcall FormDestroy(TObject *Sender);
|
||||
void __fastcall ToolButton1Click(TObject *Sender);
|
||||
void __fastcall sgEditKeyDown(TObject *Sender, WORD &Key,
|
||||
TShiftState Shift);
|
||||
void __fastcall sgEditSelectCell(TObject *Sender, int ACol,
|
||||
int ARow, bool &CanSelect);
|
||||
void __fastcall Timer1Timer(TObject *Sender);
|
||||
void __fastcall N4Click(TObject *Sender);
|
||||
void __fastcall btTxtTypeClick(TObject *Sender);
|
||||
void __fastcall ToolButton3Click(TObject *Sender);
|
||||
void __fastcall btRowSaveClick(TObject *Sender);
|
||||
void __fastcall btColSaveClick(TObject *Sender);
|
||||
void __fastcall btRowClearClick(TObject *Sender);
|
||||
void __fastcall btColClearClick(TObject *Sender);
|
||||
void __fastcall ToolButton4Click(TObject *Sender);
|
||||
private: // User declarations
|
||||
|
||||
|
||||
thOpenFile *thOpen;
|
||||
bool Term;
|
||||
|
||||
public: // User declarations
|
||||
bool OpenOk;
|
||||
|
||||
AnsiString CurrentOpenFile;
|
||||
__fastcall TFrmMain(TComponent* Owner);
|
||||
void SaveToFile(const char * pszFileName);
|
||||
void __fastcall OpenFileCol(AnsiString FileName,int ColIndex,int ColType);
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
extern PACKAGE TFrmMain *FrmMain;
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
@@ -1,124 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!-- C++Builder XML Project -->
|
||||
<PROJECT>
|
||||
<MACROS>
|
||||
<VERSION value="BCB.06.00"/>
|
||||
<PROJECT value="pjDbcEditer.exe"/>
|
||||
<OBJFILES value="pjDbcEditer.obj dbcedit.obj TitleFrm.obj thOpenSource.obj SearchFrm.obj"/>
|
||||
<RESFILES value="pjDbcEditer.res"/>
|
||||
<IDLFILES value=""/>
|
||||
<IDLGENFILES value=""/>
|
||||
<DEFFILE value=""/>
|
||||
<RESDEPEN value="$(RESFILES) dbcedit.dfm TitleFrm.dfm SearchFrm.dfm"/>
|
||||
<LIBFILES value=""/>
|
||||
<LIBRARIES value=""/>
|
||||
<SPARELIBS value="vcl.lib rtl.lib indy.lib"/>
|
||||
<PACKAGES value="vcl.bpi rtl.bpi dbrtl.bpi adortl.bpi vcldb.bpi vclx.bpi bdertl.bpi
|
||||
vcldbx.bpi ibxpress.bpi dsnap.bpi cds.bpi bdecds.bpi qrpt.bpi teeui.bpi
|
||||
teedb.bpi tee.bpi dss.bpi teeqr.bpi visualclx.bpi visualdbclx.bpi
|
||||
dsnapcrba.bpi dsnapcon.bpi bcbsmp.bpi vclie.bpi xmlrtl.bpi inet.bpi
|
||||
inetdbbde.bpi inetdbxpress.bpi inetdb.bpi nmfast.bpi webdsnap.bpi
|
||||
bcbie.bpi websnap.bpi soaprtl.bpi dclocx.bpi dbexpress.bpi dbxcds.bpi
|
||||
indy.bpi bcb2kaxserver.bpi dclusr.bpi"/>
|
||||
<PATHCPP value=".;"/>
|
||||
<PATHPAS value=".;"/>
|
||||
<PATHRC value=".;"/>
|
||||
<PATHASM value=".;"/>
|
||||
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
|
||||
<RELEASELIBPATH value="$(BCB)\lib\release"/>
|
||||
<LINKER value="ilink32"/>
|
||||
<USERDEFINES value="_DEBUG"/>
|
||||
<SYSDEFINES value="_RTLDLL;NO_STRICT;USEPACKAGES"/>
|
||||
<MAINSOURCE value="pjDbcEditer.cpp"/>
|
||||
<INCLUDEPATH value=""C:\Program Files\Borland\CBuilder6\Projects";E:\moshou\dbcEdit;$(BCB)\include;$(BCB)\include\vcl"/>
|
||||
<LIBPATH value=""C:\Program Files\Borland\CBuilder6\Projects";E:\moshou\dbcEdit;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib"/>
|
||||
<WARNINGS value="-w-par"/>
|
||||
<OTHERFILES value=""/>
|
||||
</MACROS>
|
||||
<OPTIONS>
|
||||
<IDLCFLAGS value="-I"C:\Program Files\Borland\CBuilder6\Projects" -IE:\moshou\dbcEdit
|
||||
-I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -D_DEBUG -boa"/>
|
||||
<CFLAG1 value="-Od -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -c
|
||||
-tW -tWM"/>
|
||||
<PFLAGS value="-$Y+ -$W -$O- -$A8 -v -JPHNE -M"/>
|
||||
<RFLAGS value=""/>
|
||||
<AFLAGS value="/mx /w2 /zi"/>
|
||||
<LFLAGS value="-D"" -aa -Tpe -x -Gn -v"/>
|
||||
<OTHERFILES value=""/>
|
||||
</OPTIONS>
|
||||
<LINKER>
|
||||
<ALLOBJ value="c0w32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES)"/>
|
||||
<ALLRES value="$(RESFILES)"/>
|
||||
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib"/>
|
||||
<OTHERFILES value=""/>
|
||||
</LINKER>
|
||||
<FILELIST>
|
||||
<FILE FILENAME="pjDbcEditer.res" FORMNAME="" UNITNAME="pjDbcEditer.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
<FILE FILENAME="pjDbcEditer.cpp" FORMNAME="" UNITNAME="pjDbcEditer" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
<FILE FILENAME="dbcedit.cpp" FORMNAME="FrmMain" UNITNAME="dbcedit" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
<FILE FILENAME="TitleFrm.cpp" FORMNAME="FrmTitle" UNITNAME="TitleFrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
<FILE FILENAME="thOpenSource.cpp" FORMNAME="" UNITNAME="thOpenSource" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
<FILE FILENAME="SearchFrm.cpp" FORMNAME="FrmSearch" UNITNAME="SearchFrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
</FILELIST>
|
||||
<BUILDTOOLS>
|
||||
</BUILDTOOLS>
|
||||
|
||||
<IDEOPTIONS>
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=2052
|
||||
CodePage=936
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=$(BCB)\source\vcl
|
||||
|
||||
[Parameters]
|
||||
RunParams=
|
||||
Launcher=
|
||||
UseLauncher=0
|
||||
DebugCWD=
|
||||
HostApplication=
|
||||
RemoteHost=
|
||||
RemotePath=
|
||||
RemoteLauncher=
|
||||
RemoteCWD=
|
||||
RemoteDebug=0
|
||||
|
||||
[Compiler]
|
||||
ShowInfoMsgs=0
|
||||
LinkDebugVcl=0
|
||||
LinkCGLIB=0
|
||||
|
||||
[CORBA]
|
||||
AddServerUnit=1
|
||||
AddClientUnit=1
|
||||
PrecompiledHeaders=1
|
||||
|
||||
[Language]
|
||||
ActiveLang=
|
||||
ProjectLang=
|
||||
RootDir=
|
||||
</IDEOPTIONS>
|
||||
</PROJECT>
|
||||
@@ -1,37 +0,0 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
//---------------------------------------------------------------------------
|
||||
USEFORM("dbcedit.cpp", FrmMain);
|
||||
USEFORM("TitleFrm.cpp", FrmTitle);
|
||||
USEFORM("SearchFrm.cpp", FrmSearch);
|
||||
//---------------------------------------------------------------------------
|
||||
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
try
|
||||
{
|
||||
Application->Initialize();
|
||||
Application->CreateForm(__classid(TFrmMain), &FrmMain);
|
||||
Application->CreateForm(__classid(TFrmTitle), &FrmTitle);
|
||||
Application->CreateForm(__classid(TFrmSearch), &FrmSearch);
|
||||
Application->Run();
|
||||
}
|
||||
catch (Exception &exception)
|
||||
{
|
||||
Application->ShowException(&exception);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
try
|
||||
{
|
||||
throw Exception("");
|
||||
}
|
||||
catch (Exception &exception)
|
||||
{
|
||||
Application->ShowException(&exception);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,182 +0,0 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "thOpenSource.h"
|
||||
#include "dbcedit.h"
|
||||
#include "stdio.h"
|
||||
#include <dir.h>
|
||||
#include <inifiles.hpp>
|
||||
#include <process.h>
|
||||
#pragma package(smart_init)
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Important: Methods and properties of objects in VCL can only be
|
||||
// used in a method called using Synchronize, for example:
|
||||
//
|
||||
// Synchronize(UpdateCaption);
|
||||
//
|
||||
// where UpdateCaption could look like:
|
||||
//
|
||||
// void __fastcall thOpenFile::UpdateCaption()
|
||||
// {
|
||||
// Form1->Caption = "Updated in a thread";
|
||||
// }
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
__fastcall thOpenFile::thOpenFile(bool CreateSuspended)
|
||||
: TThread(CreateSuspended)
|
||||
{
|
||||
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall thOpenFile::Execute()
|
||||
{
|
||||
//---- Place thread code here ----
|
||||
//if(!Terminated){
|
||||
// FrmMain->LoadAndModify(FrmMain->OpenDialog1->FileName.c_str());
|
||||
// FrmMain->OpenOk=true;
|
||||
//}
|
||||
thEnd=false;
|
||||
RunOpen();
|
||||
FrmMain->OpenOk=true;
|
||||
thEnd=true;
|
||||
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall thOpenFile::RunOpen()
|
||||
{
|
||||
LoadAndModify(FrmMain->OpenDialog1->FileName.c_str());
|
||||
//OpenOk=true;
|
||||
}
|
||||
|
||||
void thOpenFile::ReadAndModifyFromBuff(char *pBuff, DWORD dwSize, const char* pszFileName)
|
||||
{
|
||||
char szErrorMsg[MAX_PATH];
|
||||
char szNewFileName[MAX_PATH];
|
||||
DWORD w;
|
||||
TIniFile *ini;
|
||||
|
||||
|
||||
TypePtr p(pBuff);
|
||||
if('WDBC' != TAG(*p.dw))
|
||||
{
|
||||
_snprintf(szErrorMsg, 512, "[%s]Not Wow's dbc file!", pszFileName);
|
||||
ShowMessage(szErrorMsg);
|
||||
return;
|
||||
}
|
||||
p.dw++;
|
||||
|
||||
DWORD dwRows, dwCols, dwRowLen, dwTextLen;
|
||||
dwRows = *p.dw++;
|
||||
dwCols = *p.dw++;
|
||||
dwRowLen = *p.dw++;
|
||||
dwTextLen = *p.dw++;
|
||||
|
||||
FrmMain->sgEdit->RowCount = dwRows+1;
|
||||
FrmMain->sgEdit->ColCount = dwCols+1;
|
||||
|
||||
for(int i=0; i<FrmMain->sgEdit->RowCount; i++){
|
||||
FrmMain->sgEdit->Cells[0][i]=IntToStr(i);
|
||||
if(Terminated) return;
|
||||
}
|
||||
//设定列标题
|
||||
AnsiString iniSetFile=ExtractFilePath(Application->ExeName)+"BcdEditer.ini";
|
||||
AnsiString SectionName=ExtractFileName(FrmMain->CurrentOpenFile);
|
||||
|
||||
ini = new TIniFile( iniSetFile );
|
||||
for(int j=0; j<FrmMain->sgEdit->ColCount; j++){
|
||||
FrmMain->sgEdit->Cells[j][0]= ini->ReadString(SectionName,"ColTitle"+IntToStr(j),IntToStr(j));
|
||||
//sgEdit->Cells[j][0]=IntToStr(j);
|
||||
ColType[j]=ini->ReadInteger(SectionName,"ColType"+IntToStr(j),0);
|
||||
if(Terminated) return;
|
||||
}
|
||||
delete ini;
|
||||
|
||||
//int *ColType = new int[dwCols];
|
||||
|
||||
DWORD dwTextStartPos = dwRows*dwRowLen+20;
|
||||
char* pTextPtr = pBuff + dwTextStartPos;
|
||||
char pszTemp[MAX_PATH];
|
||||
float fTemp;
|
||||
long lTemp;
|
||||
DWORD i, j;
|
||||
BOOL* pbString = new BOOL[dwRows*dwCols];
|
||||
float newTmp;
|
||||
//int ColType;
|
||||
|
||||
ini = new TIniFile( iniSetFile );
|
||||
|
||||
for(i=0; i<dwRows; i++)
|
||||
{
|
||||
for(j=0; j<dwCols; j++)
|
||||
{
|
||||
//SleepEx(0,0);
|
||||
if(Terminated) return;
|
||||
lTemp = *p.l;
|
||||
newTmp = *p.f;
|
||||
memcpy(&fTemp, &newTmp, 4);
|
||||
|
||||
if(j==0) //ID
|
||||
FrmMain->sgEdit->Cells[j+1][i+1]=IntToStr(lTemp);
|
||||
else{
|
||||
|
||||
//ColType= ini->ReadInteger(SectionName,"ColType"+IntToStr(j),0);
|
||||
|
||||
switch (ColType[j+1])
|
||||
{
|
||||
case 0: //整型
|
||||
FrmMain->sgEdit->Cells[j+1][i+1]=IntToStr(lTemp);
|
||||
break;
|
||||
case 1: //浮点
|
||||
FrmMain->sgEdit->Cells[j+1][i+1]=FloatToStr(fTemp);
|
||||
break;
|
||||
case 2: //文本 文本类型只能看,不能编辑
|
||||
if(dwTextStartPos + lTemp < dwSize){
|
||||
pTextPtr = pBuff + dwTextStartPos + lTemp;
|
||||
FrmMain->sgEdit->Cells[j+1][i+1]=pTextPtr;
|
||||
}else{
|
||||
FrmMain->sgEdit->Cells[j+1][i+1]="该列不是文本";
|
||||
}
|
||||
break;
|
||||
default: //整型
|
||||
FrmMain->sgEdit->Cells[j+1][i+1]=IntToStr(lTemp);
|
||||
}
|
||||
}
|
||||
p.c += 4;
|
||||
}
|
||||
}
|
||||
|
||||
delete [] pbString;
|
||||
//delete [] ColType;
|
||||
delete ini;
|
||||
|
||||
}
|
||||
|
||||
void thOpenFile::LoadAndModify(const char * pszFileName)
|
||||
{
|
||||
HANDLE hFile = NULL;
|
||||
hFile = CreateFile(pszFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
if(hFile == INVALID_HANDLE_VALUE)return;
|
||||
|
||||
DWORD r = 0, nFileSize = 0;
|
||||
nFileSize = GetFileSize(hFile, NULL);
|
||||
char* pTmpBuf = new char[nFileSize];
|
||||
if(pTmpBuf==NULL)
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return;
|
||||
}
|
||||
ReadFile(hFile, pTmpBuf, nFileSize, &r, NULL);
|
||||
|
||||
FrmMain->CurrentOpenFile=pszFileName;
|
||||
FrmMain->btSave->Enabled=true;
|
||||
|
||||
ReadAndModifyFromBuff(pTmpBuf, nFileSize, pszFileName);
|
||||
|
||||
//SAFE_DELETE_ARRAY(pTmpBuf);
|
||||
delete [] pTmpBuf;
|
||||
CloseHandle(hFile);
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#ifndef thOpenSourceH
|
||||
#define thOpenSourceH
|
||||
//---------------------------------------------------------------------------
|
||||
#include <Classes.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
class thOpenFile : public TThread
|
||||
{
|
||||
private:
|
||||
protected:
|
||||
void __fastcall Execute();
|
||||
void __fastcall RunOpen();
|
||||
public:
|
||||
bool thEnd;
|
||||
int ColType[10000];
|
||||
|
||||
__fastcall thOpenFile(bool CreateSuspended);
|
||||
void LoadAndModify(const char * pszFileName);
|
||||
void ReadAndModifyFromBuff(char *pBuff, DWORD dwSize, const char* pszFileName);
|
||||
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
Binary file not shown.
@@ -1,241 +0,0 @@
|
||||
ENTRY ItemSetEntry
|
||||
|
||||
UNUSED INDEX setid
|
||||
UNUSED STR setname
|
||||
UNKNOWN[7]
|
||||
UNUSED UINT flags//, const
|
||||
UNUSED UINT required_item_id[8]
|
||||
UNKNOWN[48]
|
||||
UINT spells[8]
|
||||
UINT items_to_triggerspell[8] //items_to_triggerspell[0] -- for spells[0]
|
||||
UINT required_skill_id//only 2 items sets have requirements
|
||||
UINT required_skill_value
|
||||
|
||||
ENDENTRY
|
||||
|
||||
|
||||
ENTRY TalentEntry
|
||||
|
||||
INDEX TalentID
|
||||
UINT TalentTree
|
||||
UNKNOWN [2]
|
||||
UINT RankID[5]
|
||||
UNKNOWN[12]
|
||||
|
||||
ENDENTRY
|
||||
|
||||
|
||||
ENTRY emoteentry
|
||||
|
||||
INDEX Id
|
||||
UNUSED STR name
|
||||
UINT textid
|
||||
UNUSED UINT textid2
|
||||
UNUSED UINT textid3
|
||||
UNUSED UINT textid4
|
||||
UNKNOWN
|
||||
UNUSED UINT textid5
|
||||
UNKNOWN
|
||||
UNUSED UINT textid6
|
||||
UNKNOWN[9]
|
||||
|
||||
ENDENTRY
|
||||
|
||||
ENTRY SpellEntry
|
||||
|
||||
INDEX Id
|
||||
UINT School
|
||||
UNKNOWN [2]
|
||||
UINT Category
|
||||
UNKNOWN
|
||||
UINT Attributes
|
||||
UINT AttributesEx
|
||||
UNKNOWN [3]
|
||||
UINT Targets
|
||||
UINT TargetCreatureType
|
||||
UINT RequiresSpellFocus
|
||||
UNKNOWN
|
||||
UINT CasterAuraState
|
||||
UINT CastingTimeIndex
|
||||
UINT RecoveryTime
|
||||
UINT CategoryRecoveryTime
|
||||
UINT InterruptFlags
|
||||
UINT AuraInterruptFlags
|
||||
UINT ChannelInterruptFlags
|
||||
UINT procFlags
|
||||
UINT procChance
|
||||
UINT procCharges
|
||||
UINT maxLevel
|
||||
UINT baseLevel
|
||||
UINT spellLevel
|
||||
UINT DurationIndex
|
||||
UINT powerType
|
||||
UINT manaCost
|
||||
UINT manaCostPerlevel
|
||||
UINT manaPerSecond
|
||||
UINT manaPerSecondPerLevel
|
||||
UINT rangeIndex
|
||||
FLOAT speed
|
||||
UINT modalNextSpell
|
||||
UNKNOWN
|
||||
UINT Totem[2]
|
||||
UINT Reagent[8]
|
||||
UINT ReagentCount[8]
|
||||
UINT EquippedItemClass
|
||||
UINT EquippedItemSubClass
|
||||
UINT Effect[3] // 59 - 61
|
||||
UINT EffectDieSides[3]
|
||||
UINT EffectBaseDice[3]
|
||||
FLOAT EffectDicePerLevel[3]
|
||||
FLOAT EffectRealPointsPerLevel[3]
|
||||
INT EffectBasePoints[3] // 74 - 76
|
||||
UNKNOWN [3]
|
||||
UINT EffectImplicitTargetA[3] // 80 - 82
|
||||
UINT EffectImplicitTargetB[3] // 83 - 85
|
||||
UINT EffectRadiusIndex[3]
|
||||
UINT EffectApplyAuraName[3] // 89 - 91
|
||||
UINT EffectAmplitude[3]
|
||||
UINT Effectunknown[3]
|
||||
UINT EffectChainTarget[3]
|
||||
UINT EffectItemType[3]
|
||||
UINT EffectMiscValue[3] // 104 - 106
|
||||
UINT EffectTriggerSpell[3]
|
||||
FLOAT EffectPointsPerComboPoint[3]
|
||||
UINT SpellVisual
|
||||
UNKNOWN
|
||||
UINT SpellIconID
|
||||
UINT activeIconID
|
||||
UINT spellPriority
|
||||
UNUSED STR Name
|
||||
UNUSED STR NameAlt1
|
||||
UNUSED STR NameAlt2
|
||||
UNUSED STR NameAlt3
|
||||
UNUSED STR NameAlt4
|
||||
UNUSED STR NameAlt5
|
||||
UNUSED STR NameAlt6
|
||||
UNUSED STR NameAlt7
|
||||
UNUSED STR NameFlags
|
||||
UINT Rank
|
||||
UINT RankAlt1
|
||||
UINT RankAlt2
|
||||
UINT RankAlt3
|
||||
UINT RankAlt4
|
||||
UINT RankAlt5
|
||||
UINT RankAlt6
|
||||
UINT RankAlt7
|
||||
UINT RankFlags
|
||||
UNUSED STR Description
|
||||
UNUSED STR DescriptionAlt1
|
||||
UNUSED STR DescriptionAlt2
|
||||
UNUSED STR DescriptionAlt3
|
||||
UNUSED STR DescriptionAlt4
|
||||
UNUSED STR DescriptionAlt5
|
||||
UNUSED STR DescriptionAlt6
|
||||
UNUSED STR DescriptionAlt7
|
||||
UNUSED UINT DescriptionFlags
|
||||
UNUSED STR BuffDescription
|
||||
UNUSED STR BuffDescriptionAlt1
|
||||
UNUSED STR BuffDescriptionAlt2
|
||||
UNUSED STR BuffDescriptionAlt3
|
||||
UNUSED STR BuffDescriptionAlt4
|
||||
UNUSED STR BuffDescriptionAlt5
|
||||
UNUSED STR BuffDescriptionAlt6
|
||||
UNUSED STR BuffDescriptionAlt7
|
||||
UINT ManaCostPercentage
|
||||
UINT StartRecoveryCategory
|
||||
UINT StartRecoveryTime
|
||||
UINT field156 //nice name
|
||||
UNKNOWN[2]
|
||||
UINT SpellFamilyName
|
||||
UNKNOWN[11]
|
||||
ENDENTRY
|
||||
|
||||
ENTRY SpellCastTime
|
||||
INDEX ID
|
||||
UINT CastTime
|
||||
UNKNOWN[2]
|
||||
ENDENTRY
|
||||
|
||||
ENTRY SpellRadius
|
||||
INDEX ID
|
||||
FLOAT Radius
|
||||
UNKNOWN
|
||||
FLOAT Radius2
|
||||
ENDENTRY
|
||||
|
||||
ENTRY SpellRange
|
||||
INDEX ID
|
||||
FLOAT minRange
|
||||
FLOAT maxRange
|
||||
UNKNOWN[18]
|
||||
UNKNOWN//some flag
|
||||
ENDENTRY
|
||||
|
||||
ENTRY SpellDuration
|
||||
INDEX ID
|
||||
UINT Duration1
|
||||
UINT Duration2
|
||||
UINT Duration3
|
||||
ENDENTRY
|
||||
|
||||
ENTRY AreaTableEntry
|
||||
|
||||
UINT ID
|
||||
UNUSED UINT map
|
||||
UINT zone
|
||||
INDEX exploreFlag
|
||||
UNKNOWN[6]
|
||||
UINT area_level
|
||||
UNUSED STR name
|
||||
UNKNOWN[9]
|
||||
|
||||
ENDENTRY
|
||||
|
||||
|
||||
ENTRY FactionEntry
|
||||
INDEX ID
|
||||
INT reputationListID
|
||||
|
||||
UNKNOWN[7]
|
||||
UINT something1
|
||||
UINT something2
|
||||
UINT something3
|
||||
UINT something4
|
||||
UINT something5
|
||||
UINT something6
|
||||
UINT something7
|
||||
UINT something8
|
||||
UINT something9
|
||||
UINT faction
|
||||
|
||||
UNUSED STR name
|
||||
UNKNOWN[17]
|
||||
|
||||
ENDENTRY
|
||||
|
||||
|
||||
ENTRY FactionTemplateEntry
|
||||
INDEX ID
|
||||
UINT faction
|
||||
UNKNOWN
|
||||
UINT fightsupport
|
||||
UINT friendly
|
||||
UINT hostile
|
||||
UNKNOWN[8]
|
||||
ENDENTRY
|
||||
|
||||
|
||||
ENTRY ItemDisplayTemplateEntry
|
||||
|
||||
UINT ID
|
||||
UNUSED STR modelFile
|
||||
UNKNOWN
|
||||
UNUSED STR imageFile
|
||||
UNKNOWN
|
||||
UNUSED STR invImageFile
|
||||
UNKNOWN[5]
|
||||
UINT seed
|
||||
UNKNOWN [10]
|
||||
UINT randomPropertyID
|
||||
|
||||
ENDENTRY
|
||||
Reference in New Issue
Block a user