📄 glefset.c
字号:
/*
* Copyright (C) AU-System AB, 2000.
* All rights reserved.
*
* This software is covered by the license agreement between
* the end user and AU-System AB, and may be used and copied
* only in accordance with the terms of the said agreement.
*
* AU-System AB does not assume any responsibility or
* liability for any errors or inaccuracies in this
* software, or any consequential, incidental or indirect
* damage arising out of the use of the Generic Layout Engine
* software.
*/
#include "gledef.h"
#include "glefset.h"
#include "aapigle.h"
#include "ansilibs.h"
VOID* WIPAlloc(UINT32 size);
VOID WIPFree( VOID* memory );
extern GleFieldSet *gGleFieldSetPtr;
VOID GleFieldSetDestruct(GleFieldSet* self){
WIPFree(self->title);
WIPFree(self);
}
VOID GleFieldSetDraw(GleViewType* viewP, const GleFieldSet* self){
GleRectangleType fieldSetBounds;
memmove(&fieldSetBounds, &self->bounds, sizeof(GleRectangleType) );
fieldSetBounds.topLeft.x += - viewP->horizOffset;
fieldSetBounds.topLeft.y += - viewP->vertOffset;
GLEa_fieldSetDraw(viewP->viewId, self->title, (GleRectangleType*)&fieldSetBounds);
}
BOOL GleFieldSetRenderX(GleFieldSet* self, INT16 *xSum, INT16 *ySum, INT16 *ascentMax, INT16 *descenderMax, GleElementType *gleType, UINT16 *currentFontLineHeight, INT8 *myAlign, BOOL *myWrap, INT16 *columnLeftX, INT16 *columnWidth, VOID *viewP) {
if(!*xSum) {
*xSum = 0;
self->bounds.topLeft.x = *columnLeftX;
self->bounds.topLeft.y = *ySum;
self->bounds.extent.x = 0;
*ySum += gle_fieldset_spaceTop;
/* self->bounds.extent.x = *columnWidth ;*/
*columnLeftX += gle_fieldset_spaceLeft;
*columnWidth -= (gle_fieldset_spaceLeft + gle_fieldset_spaceRight)+1;
*gleType = self->type;
self->prevFieldSet = (GleFieldSet*)((GleViewType*)viewP)->gleFieldSetPtr;
((GleViewType*)viewP)->gleFieldSetPtr = self;
}
return (FALSE);
}
GleElement *GleFieldSetConstruct(UINT8 viewId, const WCHAR *title){
GleFieldSet *self;
INT32 n1;
INT16 nullChar = 0;
if(title)
n1 = GLEa_sizeofString(title);
else
n1 = GLEa_sizeofString((WCHAR*)&nullChar);
self = (GleFieldSet*)WIPAlloc(sizeof(GleFieldSet));
self->title = WIPAlloc(n1);
if(title)
GLEa_strcpyWchar2Gle(self->title, title);
else
GLEa_strcpyWchar2Gle(self->title, (WCHAR*)&nullChar);
self->type = FieldSet;
self->viewId = viewId;
self->chunkSize = sizeof(GleFieldSet) + n1;
#ifdef SUPPORT_PEN_NAVIGATION
self->Contains=&GleElementContains;
#endif
self->Draw=&GleFieldSetDraw;
self->RenderX=&GleFieldSetRenderX;
self->RenderY=&GleElementRenderY;
self->Destruct=&GleFieldSetDestruct;
#ifdef SUPPORT_KEY_NAVIGATION
self->IsMarkable=&GleElementIsMarkable;
#endif
self->Selected=&GleElementSelected;
return (GleElement*)self;
}
BOOL GleCloseFieldSetRenderX(GleFieldSet* self, INT16 *xSum, INT16 *ySum, INT16 *ascentMax, INT16 *descenderMax, GleElementType *gleType, UINT16 *currentFontLineHeight, INT8 *myAlign, BOOL *myWrap, INT16 *columnLeftX, INT16 *columnWidth) {
*gleType = self->type;
return (FALSE);
}
GleElement *GleCloseFieldSetConstruct(VOID){
GleCloseFieldSet *self;
self = (GleCloseFieldSet*)WIPAlloc(sizeof(GleCloseFieldSet));
self->type = CloseFieldSet;
self->chunkSize = sizeof(GleCloseFieldSet);
#ifdef SUPPORT_PEN_NAVIGATION
self->Contains=&GleElementContains;
#endif
self->Draw=&GleElementDraw;
self->RenderX=&GleCloseFieldSetRenderX;
self->RenderY=&GleElementRenderY;
self->Destruct=&GleElementDestruct;
#ifdef SUPPORT_KEY_NAVIGATION
self->IsMarkable=&GleElementIsMarkable;
#endif
self->Selected=&GleElementSelected;
return (GleElement*)self;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -