我工作的组件,用于delphi 7和delphi 2006,组件使用SynTaskDialog.pas从synopse,我已经成功地使用了SynTaskDialog.pas的delphi 7成分,但是当我试图在使用它delphi 2006来创建组件包.我收到一个错误

我在synopse.info/forum上找到了相同的解决方案
引用:
我找到了两个解决方法:要么
Run Code Online (Sandbox Code Playgroud)TD_ICONS_IDENT: array[TTaskDialogIcon] of string =( '', SMsgDlgWarning, SMsgDlgConfirm, SMsgDlgError, SMsgDlgInformation, '', SMsgDlgInformation);
并删除一些LoadResString调用或
2.使用类似函数替换指针数组
Run Code Online (Sandbox Code Playgroud)GetIconIdent(TTaskDialogIcon): Pointer
但即便如此,我无法编译组件的包.而这些错误来了
[Pascal Error] E2201 Need imported data reference ($G) to access 'SMsgDlgOK' from unit 'SynTaskDialog'
[Pascal Error] E2201 Need imported data reference ($G) to access 'SMsgDlgYes' from unit 'SynTaskDialog'
[Pascal Error] E2201 Need imported data reference ($G) to access …Run Code Online (Sandbox Code Playgroud) 我为它创建了一个自定义组件SelectOneRadio,并将其注册xyz.taglib.xml到目前为止它的工作原理.唯一的问题是我的NetBeans无法在自动完成中看到我的标记属性.例如,如果我layout="pageDirection"在我的自定义组件中,那么它会正确渲染,但是当我(Ctrl +空格)我看不到时layout,value...属性.这里是我在我注册我的自定义组件WEB-INF/faces-config.xml,我有
<component>
<component-type>com.xyz.om.ui.component.SelectOneRadio</component-type>
<component-class>
com.xyz.om.ui.component.SelectOneRadio
</component-class>
<component-extension>
<component-family>com.xyz.om.ui.component.SelectOneRadio</component-family>
<renderer-type>com.xyz.om.ui.renderer.SelectOneRadioRenderer</renderer-type>
</component-extension>
</component>
<render-kit>
<renderer>
<component-family>com.xyz.om.ui.component.SelectOneRadio</component-family>
<renderer-type>com.xyz.om.ui.renderer.SelectOneRadioRenderer</renderer-type>
<renderer-class>
com.xyz.om.ui.renderer.SelectOneRadioRenderer
</renderer-class>
</renderer>
</render-kit>
Run Code Online (Sandbox Code Playgroud)
在我WEB-INF/xyz.taglib.xml,我有
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0">
<namespace>http://example.com/ui</namespace>
<tag>
<tag-name>selectOneRadio</tag-name>
<component>
<component-type>com.xyz.om.ui.component.SelectOneRadio</component-type>
<renderer-type>com.xyz.om.ui.renderer.SelectOneRadioRenderer</renderer-type>
</component>
</tag>
</facelet-taglib>
Run Code Online (Sandbox Code Playgroud)
所以我注册xyz.taglib.xml在web.xml如下
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/xyz.taglib.xml</param-value>
</context-param>
Run Code Online (Sandbox Code Playgroud)
完成此步骤后,如果我在自定义组件上按Ctrl +空格(Netbeans),我只能看到class, id, parent , rendered, rendererType, transient.所以我尝试xyz.tld在WEB-INF下创建一个这样的
<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.1" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee …Run Code Online (Sandbox Code Playgroud) 我需要向TSpeedButton添加2个新属性.尽管在对象检查器中正确显示了属性,并且其值存储在DFM文件中,但运行时的"create"方法仍将属性设置为"nil".
怎么了 ?
这是定制的组件代码:
unit ulbSpeedButton;
interface
uses
Winapi.Windows, Winapi.Messages, System.Classes, Vcl.Controls, Vcl.Forms, Vcl.Graphics,
Vcl.StdCtrls, Vcl.ExtCtrls, Winapi.CommCtrl, Vcl.ImgList,
Vcl.Themes, System.Generics.Collections, Vcl.Buttons;
type
tlbSpeedButton = class(TSpeedButton)
private
fImageList : TImageList;
fImageIndex : Integer;
function GetImageIndex:Integer;
function GetImageList:TImageList;
procedure SetImageIndex(aIndex:Integer);
procedure SetImageList(aImageList:TImageList);
protected
public
constructor Create(AOwner: TComponent); override;
published
property ImgIndex : Integer read fImageIndex write SetImageIndex;
property ImgList : TImageList read GetImageList write SetImageList;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Leo Bruno', [tlbSpeedButton]);
end;
{ tlbSpeedButton }
constructor tlbSpeedButton.Create(AOwner: TComponent); …Run Code Online (Sandbox Code Playgroud) 在处理 JSF 自定义组件时有点卡住了。如果有人能给我一个开端,那就太好了。
这个想法是有一个组件,让我通过一个LocalDate. 想一个更简单的日期选择器。呈现的 HTML 有两个按钮,一个将日期增加一天,另一个按钮将日期减少一天。值本身存储在一个输入隐藏中。附件是组件的一个简单版本,它不起作用,但希望能描述我想要实现的目标。
这个想法是<my:datePager value="#{myBackingBean.someDate}" />在页面上说并在单击任一按钮之一后执行一些逻辑/操作。
例如<my:datePager value="#{myBackingBean.someDate} action="..." />或<my:datePager value="#{myBackingBean.someDate} previous="..." next="..."/>不知道什么更好。
这是我遇到的问题:如何调用组件上的previous和next方法?
到目前为止,这是我的 JSF 2.3 自定义组件:
@FacesComponent(LocalDatePager.COMPONENT_TYPE)
public class LocalDatePager extends UIInput {
public static final String COMPONENT_TYPE = "LocalDatePager";
public LocalDatePager() {
setConverter(LocalDateConverter.INSTANCE);
}
public void previous() {
LocalDate localDate = (LocalDate) getValue();
localDate = localDate.minusDays(1);
setValue(localDate);
}
public void next() {
LocalDate localDate = (LocalDate) getValue();
localDate = localDate.plusDays(1); …Run Code Online (Sandbox Code Playgroud) 我有组件(TPanel的后代),我实现了Transparency和BrushStyle(使用TImage)属性.
当我在表单上有一个这种类型的组件时,一切都没问题.发髻当我在表格上加注这种类型的更多组件时,只涂上第一个可见组件.当移动窗体并且第一个组件位于其他窗口或外部桌面下时,下一个组件被绘制.
unit TransparentPanel;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, stdctrls;
type
TTransparentPanel = class(TPanel)
private
FTransparent: Boolean;
FBrushStyle: TBrushStyle;
FImage: TImage;
procedure SetTransparent(const Value: Boolean);
procedure SetBrushStyle(const Value: TBrushStyle);
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Transparent: Boolean read FTransparent write SetTransparent default
True;
property BrushStyle: TBrushStyle read FBrushStyle write SetBrushStyle default
bsBDiagonal;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('TransparentPanel', [TTransparentPanel]); …Run Code Online (Sandbox Code Playgroud) 如何创建一个像Tpanel一样的TCustomControl?例如MyCustomComponent,我可以删除类似标签,图像等组件.
我试图扩展一些primefaces组件渲染器类进行相同的更改我在faces配置中注册新的渲染器
<render-kit>
<renderer>
<component-family>org.primefaces.component</component-family>
<renderer-type>org.primefaces.component.CommanButton</renderer-type>
<renderer-class>ExtendedTags.myCommandButton</renderer-class>
</renderer>
</render-kit>
Run Code Online (Sandbox Code Playgroud)
我可以看到它调用渲染器的构造函数,但没有调用其他重写的函数encodeBegin encodeEnd等.我错过了什么?primefaces组件是否有任何特殊的附加功能?这是我的渲染类
public class myCommandButton extends CommandButtonRenderer{
public myCommandButton() {
System.out.println("button constructor");
}
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
System.out.println("button encode begin");
super.encodeBegin(context, component);
ResponseWriter writer = context.getResponseWriter();
writer.write("*");
}
}
Run Code Online (Sandbox Code Playgroud) 我的列表中有这样的活动:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ListView
android:id="@+id/altOrderslist"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="#b5b5b5"
android:dividerHeight="1dp"
/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我想用这些项目制作自定义列表视图:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dip" >
<!-- ListRow Left sied Thumbnail image -->
<LinearLayout
android:id="@+id/thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="5dip"
android:padding="3dip" >
<TextView
android:id="@+id/altOrderId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rihanna Love the way lie"
android:textColor="#040404"
android:textSize="15dip"
android:textStyle="bold"
android:typeface="sans" />
</LinearLayout>
<!-- Title Of Song -->
<!-- Artist Name -->
<TextView
android:id="@+id/altOrderTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="1dip"
android:layout_toRightOf="@+id/thumbnail"
android:text="Just gona stand there and ..."
android:textColor="#343434" …Run Code Online (Sandbox Code Playgroud) 德尔福XE2
我有followind自定义组件:
TNaharWebDBEdit = class(TUniDBEdit)
private
FThemeColor : TNaharPalleteColor;
FThemeController: TNaharThemeController;
procedure OnObserver(Sender: TObject; AParam, AValue: Variant);
procedure UpdateColor;
procedure SetColor(const Value: TNaharPalleteColor);
function GetThemeManager: TNaharThemeManager;
protected
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property ThemeColor: TNaharPalleteColor read FThemeColor write SetColor default npcWhite;
property ThemeManager: TNaharThemeManager read GetThemeManager;
end;
Run Code Online (Sandbox Code Playgroud)
SetColor代码是:
procedure TNaharWebDBEdit.SetColor(const Value: TNaharPalleteColor);
begin
FThemeColor := Value;
UpdateColor;
end;
Run Code Online (Sandbox Code Playgroud)
UpdateColor只是为目标指定的主题颜色和设置在Self.Color上.
一切正常.ThemeColor属性显示在属性视图中,我可以将其更改为其他值.然而,在我保存表单并再次打开后,它又恢复到原始值,甚至不是默认值.
我制作了12个这样的组件,以及所有类似的代码.仅在Panel(来自TuniPanel)上工作正常,该属性保留在设计期间分配的值并在运行时正确检索它.
某些值未保存或未恢复属性.怎么抓住那个?
编辑:
TNaharPalleteColor = (npcMainColor, npcColorA, npcColorB, npcColorC, npcColorD, npcWhite, npcBlack, npcUnknown, npcNone);
Run Code Online (Sandbox Code Playgroud)
我已将ThemeColor的值更改为npcWhite并保存.我在Notepad ++上打开了DFM,发现它没有被保存 …
我正在编写一个敲除组件,我需要通过jquery对组件内的DOM对象进行一些操作。
如何获得对元素的引用?我无法id在其上放置属性,因为页面上该组件的每个实例都会重复该属性。
考虑以下示例:
<!-- component template -->
<div>
<p data-bind="text: name">
<audio></audio>
</div>
// View model
define(["jquery", "knockout"], function ($, ko) {
var audioElement = $("????");
function vm(params) {
var self = this;
self.name = params.name;
};
return vm;
});
Run Code Online (Sandbox Code Playgroud)
当页面上有多个组件实例时,如何获取对音频标签的jquery引用?
custom-component ×10
delphi ×5
jsf ×2
jsf-2 ×2
tpanel ×2
adapter ×1
android ×1
delphi-2006 ×1
delphi-7 ×1
delphi-xe2 ×1
inheritance ×1
javascript ×1
jquery ×1
knockout.js ×1
listview ×1
netbeans ×1
panel ×1
primefaces ×1
reference ×1
taglib ×1